picoclaw/docs
admin-mf 93fb7b8794 Merge upstream/main into sync/upstream-2026-05-07
Sync with sipeed/picoclaw upstream/main (~1095 commits since last merge),
including major restructures:

- Launcher migrated to web/backend (#1275): cmd/picoclaw-launcher/* removed.
  Our launcher is dropped (MagicForm doesn't use it; web/backend is the
  upstream replacement when needed).
- Agent loop split (#2585, 12d5421c): pkg/agent/loop.go deleted, replaced by
  pkg/agent/agent_*.go files. Multi-tenancy customizations to be forward-ported
  in follow-up commits on this branch.
- Tool packages reorganized (4c133dc2): pkg/tools/{filesystem,web}.go moved
  to pkg/tools/{fs,integration}/. Customizations to be forward-ported.
- Channels switched to map+Settings model: MagicFormConfig → MagicFormSettings
  registered in config_channel.go alongside other channels; channel constructor
  updated to (channelName, channelType, *Config, *MessageBus) factory pattern.
- Config schema updates: removed deprecated AgentDefaults.Model field;
  removed Config.Bindings (legacy migration in upstream); SessionConfig now
  uses Dimensions instead of DMScope; ExecConfig adds AllowRemote.

Conflicts resolved:
- pkg/agent/loop.go + loop_test.go: accepted upstream deletion (split)
- pkg/tools/{filesystem,web}.go: accepted upstream deletion (moved)
- cmd/picoclaw-launcher/*: dropped (deps deleted upstream, unused by MagicForm)
- cmd/picoclaw/internal/gateway/helpers.go: accepted upstream deletion
- pkg/channels/manager.go: switched to upstream's map-driven channel init
- pkg/config/config.go: merged AgentDefaults fields, kept WorkspaceRoot,
  removed deprecated Model
- pkg/bus/types.go: merged OutboundMessage with upstream's new fields
  (Context, AgentID, SessionKey, Scope, ContextUsage) plus our magicform
  callback fields (Type, Metrics, Progress, Escalation)
- pkg/tools/{cron,shell}.go: combined our customizations with upstream changes
- pkg/skills/installer.go: dropped our LimitReader path (upstream now uses
  chunked DownloadToFile which is size-bounded)

The magicform channel was rebuilt to match upstream's new API:
- *config.MagicFormSettings (SecureString token) instead of MagicFormConfig
- Send returns ([]string, error) per upstream Channel interface
- InboundMessage built with Context (with Raw map for tenancy hints) instead
  of bus.Peer + Metadata field which were removed.

Multi-tenancy hints (workspace_override, config_dir, allowed_tools,
allowed_skills) are still flowing via Context.Raw — the agent loop side of
the integration is forward-ported in a follow-up commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 12:12:44 -05:00
..
architecture feat(events): add configurable runtime event logging 2026-04-26 17:41:00 +08:00
channels Feat(channels): unify animated tool feedback across chat channels and Pico (#2622) 2026-04-23 10:35:50 +08:00
design Merge pull request #2677 from alexhoshina/feat/runtime-events-plan 2026-05-03 23:15:25 +02:00
guides Merge pull request #2677 from alexhoshina/feat/runtime-events-plan 2026-05-03 23:15:25 +02:00
migration refactor: support explicit provider field in model list entries (#2609) 2026-04-22 11:28:47 +08:00
operations feat(tool-feedback): add separate message mode for chat feedback (#2644) 2026-04-24 11:49:41 +08:00
project Add CLI support for custom OpenAI-compatible endpoints and remove TUI (#2710) 2026-04-29 17:52:47 +08:00
reference fix(mcp): normalize local command paths and document env-file usage 2026-04-24 10:32:55 +02:00
security docs: add section index pages and fix localized doc links 2026-04-17 14:00:45 +08:00
cli.md Enhance workspace path security and metrics tracking 2026-03-06 16:33:50 -06:00
magicform-integration.md Enhance workspace path security and metrics tracking 2026-03-06 16:33:50 -06:00
README.md docs: add section index pages and fix localized doc links 2026-04-17 14:00:45 +08:00

PicoClaw Documentation

PicoClaw documentation is organized by document type first and language second.

This file describes the recommended documentation layout, how translated files should be named, and what make lint-docs currently checks locally.

These conventions are intended as contributor guidance for new or moved docs. Existing docs may still have historical exceptions, and make lint-docs only checks a common subset of the patterns described here.

Reader Navigation

If you are browsing docs rather than reorganizing them, start with these directory indexes:

  • Guides: setup, configuration, provider, and workflow guides.
  • Reference: precise configuration and behavior reference.
  • Operations: debugging and troubleshooting material.
  • Security: security-focused guides and controls.
  • Architecture: implementation notes and internal design docs.
  • Migration: upgrade and migration notes.

For channel-specific setup, start with Chat Apps Configuration and then drill into docs/channels/<name>/README.md as needed.

Principles

  • Choose the document type directory first. Do not create language buckets such as docs/zh/ or docs/fr/.
  • Keep each translated document next to its English source document.
  • Use English as the base filename with no locale suffix.
  • Use lowercase locale suffixes for translations, for example configuration.zh.md or README.pt-br.md.
  • Keep module-specific docs next to the code they describe instead of moving them into docs/.
  • README.md: English project entry document at the repository root.
  • docs/project/: translated project entry documents such as README.zh.md and CONTRIBUTING.zh.md.
  • docs/guides/: setup and usage guides.
  • docs/reference/: reference material and detailed configuration docs.
  • docs/operations/: debugging and troubleshooting docs.
  • docs/security/: security-related documentation.
  • docs/architecture/: architecture and internal design notes.
  • docs/channels/: channel-specific integration guides.
  • docs/design/: design proposals and investigations.
  • docs/migration/: migration notes.
  • English documents use the base filename:
    • README.md
    • configuration.md
  • Translations use .<locale>.md:
    • README.zh.md
    • configuration.fr.md
    • README.pt-br.md
  • Code-adjacent translated READMEs follow the same rule:
    • pkg/audio/asr/README.zh.md
    • pkg/isolation/README.zh.md

Common Patterns To Avoid

  • Root-level translated entry docs such as README.zh.md or CONTRIBUTING.fr.md
    • Use docs/project/README.zh.md or docs/project/CONTRIBUTING.fr.md instead.
  • Language directories under docs/ such as docs/zh/, docs/ZH/, docs/ja/, or docs/fr/
    • Use docs/<type>/<name>.<locale>.md instead.
  • Nested locale buckets such as docs/guides/zh/configuration.md or docs/channels/telegram/zh/README.md
    • Keep translations beside the English source file instead.
  • Legacy translation filenames such as README_zh.md or README_CN.md
    • Use README.zh.md.
  • Non-canonical locale suffixes such as configuration_zh.md or configuration.ZH.md
    • Use lowercase .<locale>.md, for example configuration.zh.md.

Translation Placement

  • For docs under docs/guides, docs/reference, docs/operations, docs/security, docs/architecture, docs/channels, and docs/migration, keep translations beside the English source file.
  • For project entry translations, keep translated files in docs/project/ and keep the English source in the repository root.
  • In most cases, each translated file should have an English source document:
    • docs/guides/configuration.zh.md usually sits beside docs/guides/configuration.md
    • docs/project/README.zh.md usually corresponds to README.md
  • Exception: docs/design/ may contain locale-specific working notes without an English source document. The naming rules still apply there.

Code-Adjacent Docs

Keep documentation next to the implementation when it primarily describes a package, command, example, or subproject.

Examples:

  • pkg/**/README.md
  • cmd/**/README.md
  • web/README.md
  • examples/**/README.md

These files still follow the same translation naming rules.

Adding a New Document

  1. Pick the correct document type directory.
  2. Create the English source file first.
  3. Add translated siblings after the English source exists when that source is part of the same docs set.
  4. Update links from existing docs when the new doc becomes a navigation target.
  5. Run make lint-docs locally when adding or moving docs.

Examples

  • New setup guide:
    • docs/guides/launcher-setup.md
    • docs/guides/launcher-setup.zh.md
  • New security guide:
    • docs/security/token-rotation.md
  • New translated package README:
    • pkg/channels/README.zh.md

Validation

Run:

make lint-docs

The local docs linter currently checks these common cases:

  • no root-level translated README or CONTRIBUTING files
  • no docs/<locale>/ language buckets, regardless of case
  • no nested locale buckets under typed docs directories
  • no legacy README_*.md filenames
  • no non-canonical translation-like filenames such as _zh.md or .ZH.md
  • no extra Markdown files directly under docs/ except docs/README.md
  • every translated Markdown file has a matching English source file
    • except for locale-specific working notes under docs/design/

make lint-docs is a local consistency check for common naming and placement mistakes. It helps contributors stay close to the recommended layout, but it is not intended to describe every acceptable documentation pattern in the repository.

When a check fails, make lint-docs prints the failing path, the reason, and a suggested fix.

If you change these recommendations or want the local linter to reflect them more closely, update this file and scripts/lint-docs.sh together.