Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
package handler
import (
"fmt"
"strings"
"github.com/multica-ai/multica/server/internal/service"
)
// mikaOnboardingOpenings is Mika's first reply, written by the product rather
// than generated by an agent run (MUL-5827).
//
// It reads as an agent's words, but it is the least agent-dependent output in
// the product: it consults no workspace state, calls no tool, and makes no
// decision. The multica-onboarding skill already pinned it to four beats under
// a length budget, so an agent run was paying a runtime cold start and two
// model round trips to render something already decided — while the member
// watched a spinner, and a failed run greeted them with an error bubble.
//
// The four beats, in order, are load-bearing; keep them when editing:
//
// 1. what Multica is, in one sentence,
// 2. who Mika is to this member,
// 3. what happens next,
// 4. the bridge to the starter cards rendered underneath.
//
// Deliberately NOT varied by role or use case. Seven use cases across four
// languages is a copy matrix nobody can keep coherent, and the questionnaire
// still reaches the model — it rides the kickoff into the member's first real
// turn, which is where tailoring actually pays. Nor is it varied by anything
// the member did in another workspace: every workspace opens from scratch.
//
// %[1]s is the workspace name, %[2]s Mika's display name. Both are
// owner-editable, so both are arguments and never part of the format string.
var mikaOnboardingOpenings = map[string]string{
"en": `Hi — welcome to %[1]s. Multica is a workspace where you and AI agents coordinate real work through issues.
I'm %[2]s, your Chief of Staff here. I shape what needs doing, bring in the right agent for it, and stay your starting point for anything.
Here's how we begin: you name a goal, I turn it into an issue and start it with the right agent — and you watch it run.
Pick one below, or just tell me what you want to get done right now.`,
"zh": `你好,欢迎来到 %[1]s。Multica 是一个人和 AI 智能体通过任务一起把事情做完的工作区。
我是 %[2]s,这里的 Chief of Staff。我负责把事情理清楚、找到合适的智能体接手,也是你随时可以开口的第一站。
接下来是这样:你说一个目标,我把它变成一个任务,交给合适的智能体开始跑,你能看着它推进。
从下面选一个开始,或者直接告诉我你现在想做成什么。`,
"ja": `こんにちは。%[1]s へようこそ。Multica は、人と AI エージェントがタスクを通じて実際の仕事を進めるワークスペースです。
私は %[2]s、ここの Chief of Staff です。やることを整理し、適したエージェントに引き継ぎ、いつでも最初に声をかけてもらえる存在でいます。
進め方はこうです。目標をひとこと教えてください。私がそれをタスクにして、適したエージェントで動かします。進み方はそのまま見られます。
下から一つ選ぶか、いま進めたいことをそのまま教えてください。`,
"ko": `안녕하세요, %[1]s에 오신 걸 환영합니다. Multica는 사람과 AI 에이전트가 태스크를 통해 실제 일을 함께 진행하는 워크스페이스입니다.
저는 이곳의 Chief of Staff, %[2]s입니다. 할 일을 정리하고, 알맞은 에이전트를 붙이고, 언제든 먼저 말을 걸 수 있는 시작점이 되어 드립니다.
시작은 이렇습니다. 목표를 한 줄로 알려주시면 제가 태스크로 만들어 알맞은 에이전트로 실행합니다. 진행 상황은 그대로 보실 수 있어요.
아래에서 하나 고르시거나, 지금 해내고 싶은 일을 그대로 말씀해 주세요.`,
}
// buildMikaOnboardingOpening renders the opening for a language the caller has
// already validated against mikaOnboardingLanguages, so the map lookup cannot
// miss. The name falls back to the product default when an owner has blanked
// it, because the sentence is about who is speaking and reads as broken without
// one.
func buildMikaOnboardingOpening(language, agentName, workspaceName string) string {
name := strings.TrimSpace(agentName)
if name == "" {
name = service.MikaDefaultName
}
return fmt.Sprintf(
mikaOnboardingOpenings[language],
escapeMarkdownInline(strings.TrimSpace(workspaceName)),
escapeMarkdownInline(name),
)
}
// escapeMarkdownInline neutralizes the inline markdown metacharacters in
// member-authored names before they are interpolated into rendered copy. Chat
// renders assistant content as markdown, so a workspace called `**Ops**` would
// otherwise bold part of Mika's first sentence, and one containing a backtick
// would open a code span that swallows the rest of the line.
//
// Backslash goes first so it never double-escapes an escape this adds. Only
// inline constructs are covered: the names are interpolated mid-sentence, never
// at the start of a line, so block markers like `#` and `-` are inert.
var markdownInlineEscaper = strings.NewReplacer(
`\`, `\\`,
"`", "\\`",
`*`, `\*`,
`_`, `\_`,
`~`, `\~`,
`[`, `\[`,
`]`, `\]`,
`<`, `\<`,
)
func escapeMarkdownInline(s string) string {
return markdownInlineEscaper.Replace(s)
}