Add Context Studio Wizard — project scaffolding CLI
- wizard.sh: interactive bash wizard that scaffolds new CS projects - lib/: utils, core install, project structure, workflow generation - templates/: Dockerfile, devcontainer.json, agent presets (minimal/standard), system.json, roles, hook rules - README: setup, usage, mobility workflow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cd5b28919c
commit
09ff27be92
19 changed files with 1132 additions and 1 deletions
40
templates/Dockerfile
Normal file
40
templates/Dockerfile
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
FROM node:22-bookworm-slim
|
||||
|
||||
# ── System dependencies ──────────────────────────────────────────────────────
|
||||
# Build tools: needed for node-pty (native module) and Electron
|
||||
# xvfb + libgtk: needed if running Electron inside container with virtual display
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
curl \
|
||||
wget \
|
||||
ca-certificates \
|
||||
python3 \
|
||||
make \
|
||||
g++ \
|
||||
libx11-dev \
|
||||
libxkbfile-dev \
|
||||
libsecret-1-dev \
|
||||
libfontconfig1 \
|
||||
libgbm1 \
|
||||
libasound2 \
|
||||
xvfb \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# ── Rust toolchain ───────────────────────────────────────────────────────────
|
||||
ENV RUSTUP_HOME=/usr/local/rustup \
|
||||
CARGO_HOME=/usr/local/cargo \
|
||||
PATH=/usr/local/cargo/bin:$PATH
|
||||
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
||||
| sh -s -- -y --no-modify-path --default-toolchain stable \
|
||||
&& rustup component add clippy rustfmt \
|
||||
&& chmod -R a+w /usr/local/rustup /usr/local/cargo
|
||||
|
||||
# ── Claude Code CLI ──────────────────────────────────────────────────────────
|
||||
RUN npm install -g @anthropic-ai/claude-code
|
||||
|
||||
# ── Workspace ────────────────────────────────────────────────────────────────
|
||||
WORKDIR /workspace
|
||||
|
||||
# Context Studio Core is mounted at /opt/context-studio/core (read-only from host)
|
||||
# Workflow lives at /workspace/workflow (per-project, writable)
|
||||
92
templates/agents-minimal.json
Normal file
92
templates/agents-minimal.json
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
{
|
||||
"version": "2.2",
|
||||
"projectName": "{{PROJECT_NAME}}",
|
||||
"projectDescription": "{{PROJECT_DESC}}",
|
||||
"features": {
|
||||
"use_database_tracking": true
|
||||
},
|
||||
"agentGroups": [
|
||||
{
|
||||
"name": "Coordination",
|
||||
"agents": ["kai"],
|
||||
"color": "#a6e3a1"
|
||||
},
|
||||
{
|
||||
"name": "Development",
|
||||
"agents": ["dev", "ace"],
|
||||
"color": "#89b4fa"
|
||||
},
|
||||
{
|
||||
"name": "Quality",
|
||||
"agents": ["rex", "kit"],
|
||||
"color": "#f9e2af"
|
||||
}
|
||||
],
|
||||
"agents": [
|
||||
{
|
||||
"id": "kai",
|
||||
"name": "Lead Coordinator",
|
||||
"workingDirectory": "agents/kai",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "coordinator",
|
||||
"description": "Central coordination — receives tasks from user, plans work, delegates to agents",
|
||||
"capabilities": ["coordination", "documentation", "monitoring", "delegation"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "dev",
|
||||
"name": "Developer",
|
||||
"workingDirectory": "agents/dev",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "coder",
|
||||
"description": "Primary developer — implements features, writes code, fixes bugs",
|
||||
"capabilities": ["coding", "debugging", "refactoring"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "ace",
|
||||
"name": "Developer 2",
|
||||
"workingDirectory": "agents/ace",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "coder",
|
||||
"description": "Secondary developer — parallel implementation, code reviews",
|
||||
"capabilities": ["coding", "debugging", "refactoring"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "rex",
|
||||
"name": "Researcher",
|
||||
"workingDirectory": "agents/rex",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "researcher",
|
||||
"description": "Research and discovery — investigates APIs, patterns, documentation",
|
||||
"capabilities": ["research", "documentation", "analysis"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "kit",
|
||||
"name": "Tester",
|
||||
"workingDirectory": "agents/kit",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "tester",
|
||||
"description": "Testing and quality assurance — writes tests, validates behavior",
|
||||
"capabilities": ["testing", "validation", "bug-reporting"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
}
|
||||
]
|
||||
}
|
||||
149
templates/agents-standard.json
Normal file
149
templates/agents-standard.json
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
{
|
||||
"version": "2.2",
|
||||
"projectName": "{{PROJECT_NAME}}",
|
||||
"projectDescription": "{{PROJECT_DESC}}",
|
||||
"features": {
|
||||
"use_database_tracking": true
|
||||
},
|
||||
"agentGroups": [
|
||||
{
|
||||
"name": "Coordination",
|
||||
"agents": ["kai", "sam"],
|
||||
"color": "#a6e3a1"
|
||||
},
|
||||
{
|
||||
"name": "Development",
|
||||
"agents": ["dev", "ace", "bolt"],
|
||||
"color": "#89b4fa"
|
||||
},
|
||||
{
|
||||
"name": "Research",
|
||||
"agents": ["rex", "doc"],
|
||||
"color": "#cba6f7"
|
||||
},
|
||||
{
|
||||
"name": "Quality",
|
||||
"agents": ["kit", "lens"],
|
||||
"color": "#f9e2af"
|
||||
}
|
||||
],
|
||||
"agents": [
|
||||
{
|
||||
"id": "kai",
|
||||
"name": "Lead Coordinator",
|
||||
"workingDirectory": "agents/kai",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "coordinator",
|
||||
"description": "Central coordination — receives tasks from user, plans work, delegates to sub-coordinators and agents",
|
||||
"capabilities": ["coordination", "documentation", "monitoring", "delegation"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "sam",
|
||||
"name": "Sub-coordinator",
|
||||
"workingDirectory": "agents/sam",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "subcoordinator",
|
||||
"description": "Sub-coordination — manages a group of agents for a specific workstream",
|
||||
"capabilities": ["coordination", "delegation", "tracking"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "dev",
|
||||
"name": "Developer",
|
||||
"workingDirectory": "agents/dev",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "coder",
|
||||
"description": "Primary developer — implements features, writes code, fixes bugs",
|
||||
"capabilities": ["coding", "debugging", "refactoring"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "ace",
|
||||
"name": "Developer 2",
|
||||
"workingDirectory": "agents/ace",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "coder",
|
||||
"description": "Secondary developer — parallel implementation",
|
||||
"capabilities": ["coding", "debugging", "refactoring"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "bolt",
|
||||
"name": "Developer 3",
|
||||
"workingDirectory": "agents/bolt",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "coder",
|
||||
"description": "Tertiary developer — specialised tasks and overflow",
|
||||
"capabilities": ["coding", "debugging"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "rex",
|
||||
"name": "Researcher",
|
||||
"workingDirectory": "agents/rex",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "researcher",
|
||||
"description": "Lead researcher — investigates APIs, patterns, architecture",
|
||||
"capabilities": ["research", "documentation", "analysis"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "doc",
|
||||
"name": "Documentation",
|
||||
"workingDirectory": "agents/doc",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "researcher",
|
||||
"description": "Documentation specialist — writes docs, technical writing",
|
||||
"capabilities": ["documentation", "research", "writing"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "kit",
|
||||
"name": "Tester",
|
||||
"workingDirectory": "agents/kit",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "tester",
|
||||
"description": "Testing and quality assurance — writes tests, validates behavior",
|
||||
"capabilities": ["testing", "validation", "bug-reporting"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
},
|
||||
{
|
||||
"id": "lens",
|
||||
"name": "Code Reviewer",
|
||||
"workingDirectory": "agents/lens",
|
||||
"hooks": ".claude/hooks/",
|
||||
"settings": ".claude/settings.json",
|
||||
"role": "reviewer",
|
||||
"description": "Code review — reviews PRs, enforces standards, flags issues",
|
||||
"capabilities": ["code-review", "standards", "security"],
|
||||
"cli": "claude code",
|
||||
"provider": "claude",
|
||||
"cliParams": ["--dangerously-skip-permissions"]
|
||||
}
|
||||
]
|
||||
}
|
||||
36
templates/devcontainer.json
Normal file
36
templates/devcontainer.json
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"name": "{{PROJECT_NAME}}",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
|
||||
"workspaceFolder": "/workspace",
|
||||
"mounts": [
|
||||
"source=${localEnv:HOME}/.context-studio/core,target=/opt/context-studio/core,type=bind,consistency=cached",
|
||||
"source=${localEnv:HOME}/.anthropic,target=/root/.anthropic,type=bind,consistency=cached"
|
||||
],
|
||||
"remoteEnv": {
|
||||
"ANTHROPIC_API_KEY": "${localEnv:ANTHROPIC_API_KEY}",
|
||||
"CS_CORE_DIR": "/opt/context-studio/core",
|
||||
"CS_WORKFLOW_DIR": "/workspace/workflow",
|
||||
"PROJECT_ROOT_DIR": "/workspace",
|
||||
"DISPLAY": "${localEnv:DISPLAY}"
|
||||
},
|
||||
"postCreateCommand": "cd /opt/context-studio/core && npm install && git config --global --add safe.directory /workspace && git config --global --add safe.directory /opt/context-studio/core",
|
||||
"runArgs": [
|
||||
"--init",
|
||||
"--cap-add=SYS_PTRACE",
|
||||
"--security-opt", "seccomp=unconfined"
|
||||
],
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"rust-lang.rust-analyzer",
|
||||
"ms-vscode.cpptools"
|
||||
],
|
||||
"settings": {
|
||||
"terminal.integrated.defaultProfile.linux": "bash"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
17
templates/hooks/rules/coordinator.json
Normal file
17
templates/hooks/rules/coordinator.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"role": "coordinator",
|
||||
"rules": [
|
||||
{
|
||||
"tool": "Bash",
|
||||
"pattern": ".*",
|
||||
"action": "warn",
|
||||
"message": "Coordinators should delegate implementation to coders. Are you sure you want to run this command directly?"
|
||||
},
|
||||
{
|
||||
"tool": "Edit",
|
||||
"pattern": ".*",
|
||||
"action": "warn",
|
||||
"message": "Coordinators should delegate code changes to coders via /sm."
|
||||
}
|
||||
]
|
||||
}
|
||||
4
templates/hooks/rules/default.json
Normal file
4
templates/hooks/rules/default.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"role": "default",
|
||||
"rules": []
|
||||
}
|
||||
19
templates/roles/coder-role.md
Normal file
19
templates/roles/coder-role.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Coder Role
|
||||
|
||||
You are a Developer in a multi-agent development team managed by Context Studio.
|
||||
|
||||
## Responsibilities
|
||||
- Implement features and fix bugs as delegated by the coordinator
|
||||
- Write clean, maintainable code
|
||||
- Follow project conventions and tech stack
|
||||
|
||||
## Communication
|
||||
- Receive tasks via A2A messages
|
||||
- Report completion or blockers back to coordinator via `/sm kai "status"`
|
||||
- Ask for clarification when requirements are ambiguous
|
||||
|
||||
## Principles
|
||||
- Read existing code before modifying it
|
||||
- Prefer editing existing files over creating new ones
|
||||
- Write tests for non-trivial logic
|
||||
- Keep changes focused on the task
|
||||
20
templates/roles/coordinator-role.md
Normal file
20
templates/roles/coordinator-role.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Coordinator Role
|
||||
|
||||
You are a Lead Coordinator in a multi-agent development team managed by Context Studio.
|
||||
|
||||
## Responsibilities
|
||||
- Receive tasks from the user
|
||||
- Break down tasks into subtasks and delegate to appropriate agents
|
||||
- Track progress and consolidate results
|
||||
- Report status back to the user
|
||||
|
||||
## Communication
|
||||
- Send messages to agents via `/sm <agent-id> "message"`
|
||||
- Monitor agent status
|
||||
- Escalate blockers to the user
|
||||
|
||||
## Principles
|
||||
- Delegate implementation to coders — do not write code yourself
|
||||
- Delegate research to researchers
|
||||
- Delegate testing to testers
|
||||
- Keep the user informed of progress
|
||||
18
templates/roles/researcher-role.md
Normal file
18
templates/roles/researcher-role.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Researcher Role
|
||||
|
||||
You are a Researcher in a multi-agent development team managed by Context Studio.
|
||||
|
||||
## Responsibilities
|
||||
- Investigate APIs, libraries, patterns, and documentation
|
||||
- Produce concise research reports for the coordinator and coders
|
||||
- Answer technical questions with evidence
|
||||
|
||||
## Communication
|
||||
- Receive research tasks via A2A messages
|
||||
- Report findings back via `/sm kai "findings"` or the requesting agent
|
||||
- Store research results in `project-docs/` when relevant
|
||||
|
||||
## Principles
|
||||
- Prefer official documentation over Stack Overflow
|
||||
- Summarize findings — do not dump raw docs
|
||||
- Flag uncertainties and alternatives
|
||||
17
templates/roles/reviewer-role.md
Normal file
17
templates/roles/reviewer-role.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Reviewer Role
|
||||
|
||||
You are a Code Reviewer in a multi-agent development team managed by Context Studio.
|
||||
|
||||
## Responsibilities
|
||||
- Review code written by developers
|
||||
- Enforce coding standards and best practices
|
||||
- Flag security issues, performance problems, and design smells
|
||||
|
||||
## Communication
|
||||
- Receive review tasks via A2A messages
|
||||
- Report review results back to coordinator via `/sm kai "review complete"`
|
||||
|
||||
## Principles
|
||||
- Be constructive — suggest improvements, not just problems
|
||||
- Distinguish must-fix from nice-to-have
|
||||
- Check for security vulnerabilities (injection, XSS, auth bypass, etc.)
|
||||
19
templates/roles/subcoordinator-role.md
Normal file
19
templates/roles/subcoordinator-role.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Sub-coordinator Role
|
||||
|
||||
You are a Sub-coordinator in a multi-agent development team managed by Context Studio.
|
||||
|
||||
## Responsibilities
|
||||
- Manage a group of agents for a specific workstream (e.g. backend, frontend)
|
||||
- Receive delegated work from the Lead Coordinator
|
||||
- Break it down further and delegate to specialists in your group
|
||||
- Report consolidated progress back to the Lead Coordinator
|
||||
|
||||
## Communication
|
||||
- Receive tasks from Lead Coordinator (`kai`) via A2A messages
|
||||
- Delegate to agents in your group via `/sm <agent> "task"`
|
||||
- Report back to kai via `/sm kai "status"`
|
||||
|
||||
## Principles
|
||||
- Do not implement code yourself — delegate to coders
|
||||
- Track all delegated tasks and follow up on completion
|
||||
- Escalate blockers to the Lead Coordinator
|
||||
17
templates/roles/tester-role.md
Normal file
17
templates/roles/tester-role.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Tester Role
|
||||
|
||||
You are a Tester in a multi-agent development team managed by Context Studio.
|
||||
|
||||
## Responsibilities
|
||||
- Write and run tests for features implemented by coders
|
||||
- Report bugs with reproduction steps
|
||||
- Validate acceptance criteria
|
||||
|
||||
## Communication
|
||||
- Receive testing tasks via A2A messages
|
||||
- Report test results and bugs back to coordinator via `/sm kai "results"`
|
||||
|
||||
## Principles
|
||||
- Test edge cases, not just happy paths
|
||||
- Write automated tests where possible
|
||||
- Keep bug reports actionable: what failed, what was expected, how to reproduce
|
||||
43
templates/system.json
Normal file
43
templates/system.json
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"version": "1.0",
|
||||
"registry": {
|
||||
"database": "./data/registry.db",
|
||||
"port": 8000
|
||||
},
|
||||
"system": {
|
||||
"startup_delay": 1500,
|
||||
"message_timeout": 30000,
|
||||
"max_message_size": 1048576,
|
||||
"heartbeat_interval": 30000,
|
||||
"heartbeat_timeout": 5000,
|
||||
"heartbeat_failure_threshold": 3,
|
||||
"log_level": "info",
|
||||
"debug_mode": false
|
||||
},
|
||||
"security": {
|
||||
"max_queue_size_per_agent": 1000,
|
||||
"max_messages_per_agent": 5000,
|
||||
"max_sse_connections_per_agent": 5,
|
||||
"rate_limit_enabled": true,
|
||||
"max_requests_per_minute_per_agent": 100,
|
||||
"sanitize_input": true,
|
||||
"bypass_localhost": true
|
||||
},
|
||||
"monitor": {
|
||||
"pane_detection_max_retries": 5,
|
||||
"pane_cache_duration": 300000,
|
||||
"auto_recovery_interval": 60000,
|
||||
"sse_reconnect_initial_delay": 200,
|
||||
"sse_reconnect_max_delay": 5000
|
||||
},
|
||||
"a2aInjection": {
|
||||
"chunkSize": 8192,
|
||||
"chunkDelayMs": 5,
|
||||
"scaledDelayBaseMs": 50,
|
||||
"scaledDelayPerChunkMs": 40,
|
||||
"scaledDelayMinMs": 100,
|
||||
"busyFlagTimeoutMs": 30000,
|
||||
"injectionTimeoutMs": 600000,
|
||||
"debugMode": false
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue