AgentSkillsCN

workspace-manager

通过逻辑工作空间,灵活管理跨多个组织与不同业务场景的开发任务。 适用场景:(1) 为新项目或新组织创建专属工作空间;(2) 列出可用的工作空间;(3) 切换当前活动工作空间;(4) 针对特定工作空间配置专属设置(如 GitHub/JIRA Token、工作目录等)。 工作空间能够有效隔离配置,让您在处理个人项目与工作项目时互不干扰,彻底告别冲突困扰。

SKILL.md
--- frontmatter
name: workspace-manager
description: |
  Manage logical workspaces for organizing development across multiple organizations/contexts.
  Use when: (1) Creating a new workspace for a project/org, (2) Listing available workspaces,
  (3) Switching active workspace, (4) Configuring workspace-specific settings (GitHub/JIRA tokens, work directory).
  Workspaces isolate configuration so you can work on personal projects vs work projects without conflicts.

Workspace Manager

Manage workspaces stored in ~/.brn/config.yaml. Each workspace represents a logical development context (e.g., "personal", "work", "client-acme").

Quick Reference

ActionScript
Create workspacescripts/create_workspace.sh <name> <work_dir>
List workspacesscripts/list_workspaces.sh
Show activescripts/get_active_workspace.sh
Switch workspacescripts/switch_workspace.sh <name>
Configure workspacescripts/configure_workspace.sh <name> <key> <value>

Config Structure

Global: ~/.brn/config.yaml

yaml
version: "1.0"
active_workspace: personal
workspaces:
  personal:
    path: ~/dev/personal/auto
    github_token: ghp_xxxx
    jira_token: null
    jira_url: null
    jira_email: null
    # Automation settings (all default to false for safety)
    automation:
      github_auto_push: false      # Auto-push commits
      github_auto_pr: false        # Auto-create PRs
      jira_auto_transition: false  # Auto-update ticket status
      jira_auto_comment: false     # Auto-add comments
  work:
    path: ~/dev/work/auto
    github_token: ghp_yyyy
    jira_token: jira_xxxx
    jira_url: https://company.atlassian.net
    jira_email: you@company.com
    automation:
      github_auto_push: true       # Work flow might be more automated
      github_auto_pr: false
      jira_auto_transition: true
      jira_auto_comment: true

Workflow Examples

Create a new workspace

bash
# Create workspace with work directory
./scripts/create_workspace.sh personal ~/dev/personal/auto

# Configure GitHub token
./scripts/configure_workspace.sh personal github_token ghp_xxxxx

Switch context

bash
# See what's available
./scripts/list_workspaces.sh

# Switch to work context
./scripts/switch_workspace.sh work

Integration

Other brn skills should call get_active_workspace.sh to determine which config context to use for API tokens and work directories.