Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.
sessions: Factory Droid's skill calls count in the overview
yetone23e63f1a369b
diff --git a/internal/sessions/droid.go b/internal/sessions/droid.goindex 2f8c53ac5..09cef5dbb 100644--- a/internal/sessions/droid.go+++ b/internal/sessions/droid.go@@ -2,6 +2,7 @@ package sessionsimport ("encoding/json"+ "html""os""path/filepath""regexp"@@ -152,22 +153,68 @@ func droidText(raw json.RawMessage) string {return strings.Join(parts, "\n")}-// droidTools are a message's tool calls, by name.-func droidTools(raw json.RawMessage) []string {+// droidTools are a message's tool calls: each tool's name, and the skill+// a call of Droid's Skill tool calls up ({"skill":"<name>"}).+func droidTools(raw json.RawMessage) [][2]string {var blocks []struct {- Type string `json:"type"`- Name string `json:"name"`+ Type string `json:"type"`+ Name string `json:"name"`+ Input struct {+ Skill any `json:"skill"`+ } `json:"input"`}json.Unmarshal(raw, &blocks)- var out []string+ var out [][2]stringfor _, b := range blocks {if b.Type == "tool_use" && b.Name != "" {- out = append(out, b.Name)+ skill, _ := b.Input.Skill.(string)+ if b.Name != "Skill" {+ skill = ""+ }+ out = append(out, [2]string{b.Name, strings.TrimSpace(skill)})}}return out}+// droidPicked is what droid says, in the <system-notification> it puts+// after a prompt, of each skill the user called up by typing /<name> (or+// a builtin one droid ran for them); <skill filePath="…"> and+// <name>…</name> follow it, the name HTML-escaped.+const droidPicked = "selected the following skill for immediate execution"++// droidSlashSkills are the skills a prompt calls up by /<name>: one for+// each notification droid added. A /<name> no skill has gets none, and+// is sent as typed.+func droidSlashSkills(text string) []string {+ var out []string+ for rest := text; ; {+ i := strings.Index(rest, droidPicked)+ if i < 0 {+ return out+ }+ rest = rest[i+len(droidPicked):]+ j := strings.Index(rest, "<skill filePath=\"")+ if j < 0 {+ return out+ }+ rest = rest[j:]+ k := strings.Index(rest, "\">\n<name>")+ if k < 0 || strings.ContainsRune(rest[:k], '\n') {+ continue+ }+ rest = rest[k+len("\">\n<name>"):]+ name, after, ok := strings.Cut(rest, "</name>")+ if !ok || strings.ContainsRune(name, '\n') {+ continue+ }+ rest = after+ if name = strings.TrimSpace(html.UnescapeString(name)); name != "" {+ out = append(out, name)+ }+ }+}+// droidCarry is what a read of a Droid transcript carries on with: where// it read to, whether it has passed the session_start line and a fork's// copied lines, and what its settings' total was counted as, to be taken@@ -261,6 +308,9 @@ func droidLineOf(s *state, c *droidCarry, b []byte, main bool) {switch l.Message.Role {case "user":text := droidText(l.Message.Content)+ for _, k := range droidSlashSkills(text) {+ s.tool(at, "", k)+ }if strings.TrimSpace(text) == "" || !main {return}@@ -278,8 +328,8 @@ func droidLineOf(s *state, c *droidCarry, b []byte, main bool) {if main {s.day(dateOf(at)).Replies++}- for _, name := range droidTools(l.Message.Content) {- s.tool(at, name, "")+ for _, c := range droidTools(l.Message.Content) {+ s.tool(at, c[0], c[1])}}}diff --git a/internal/sessions/droid_skills_test.go b/internal/sessions/droid_skills_test.gonew file mode 100644index 000000000..682e21c97--- /dev/null+++ b/internal/sessions/droid_skills_test.go@@ -0,0 +1,81 @@+package sessions++import (+ "path/filepath"+ "testing"+ "time"+)++// Factory Droid's skills (MaxMooreMy on X: "droid 也能帮忙修复下吗",+// Sessions' Skills card said no skill was called). The four sessions in+// testdata/droid-skills are real droid 0.231.0 sessions, run headless+// (droid exec, on a custom model through magpie's gateway) in a sandbox+// home, byte for byte; only the folder of their working directory is+// named shorter. In one the model reads notes.txt and calls the Skill+// tool for greet-user; in one the user types /greet-user, and in one+// /greet-user /wave-hand, which droid sends with a <system-notification>+// per skill; one types /nonexistentzz, which no skill has and droid sends+// as typed.+func TestDroidToolsAndSkills(t *testing.T) {+ inZone(t, 0)+ home := setupAgents(t)+ t.Setenv("FACTORY_HOME_OVERRIDE", "")+ copyTree(t, "testdata/droid-skills", filepath.Join(home, ".factory"))+ Reset()++ s := statsAt(0, time.Date(2026, 10, 30, 0, 0, 0, 0, time.UTC))+ by := map[string]Summary{}+ for _, x := range s.Sessions {+ if x.Agent == "droid" {+ by[x.ID] = x+ }+ }+ if len(by) != 4 {+ t.Fatalf("want the 4 Droid sessions, got %d", len(by))+ }+ called := by["86f11060-c188-4609-942b-8c3fc53638dc"]+ if called.ToolCalls != 2 || called.tools.of("Read") != 1 || called.tools.of("Skill") != 1 {+ t.Fatalf("tools %d %v", called.ToolCalls, called.tools)+ }+ if called.skills.of("greet-user") != 1 || len(called.skills) != 1 {+ t.Fatalf("the Skill tool's skill: %v", called.skills)+ }+ typed := by["cb1d8bed-aa2c-4ba2-a23f-681dc5da403f"]+ if typed.ToolCalls != 0 || typed.skills.of("greet-user") != 1 || len(typed.skills) != 1 {+ t.Fatalf("/greet-user: %d %v", typed.ToolCalls, typed.skills)+ }+ if typed.Title != "/greet-user" {+ t.Fatalf("/greet-user's title: %q", typed.Title)+ }+ two := by["aea4c8cc-92da-4695-889d-5ad6c5b6cec3"]+ if two.skills.of("greet-user") != 1 || two.skills.of("wave-hand") != 1 || len(two.skills) != 2 {+ t.Fatalf("/greet-user /wave-hand: %v", two.skills)+ }+ if x := by["99bfae77-1ca3-4cc9-9c35-445f1fe4dfcd"]; x.ToolCalls != 0 || len(x.skills) != 0 {+ t.Fatalf("/nonexistentzz: %d %v", x.ToolCalls, x.skills)+ }+ o := s.Overview("", "", "", 10)+ if o.Skills.Calls != 4 || o.Skills.Top[0].Name != "greet-user" || o.Skills.Top[0].Agents["droid"] != 3 {+ t.Fatalf("overview skills %+v", o.Skills)+ }+}++func TestDroidSlashSkills(t *testing.T) {+ for _, c := range []struct {+ text string+ want []string+ }{+ {"/greet-user", nil},+ {"selected the following skill for immediate execution", nil},+ {"/a&b\n\n<system-notification>\nThe user has selected the following skill for immediate execution by typing /a&b in their message.\n<skill filePath=\"/s/a&b/SKILL.md\">\n<name>a&b</name>\n</skill>\n</system-notification>", []string{"a&b"}},+ // the builtin's wording, with no "by typing"+ {"<system-notification>\nThe user has selected the following skill for immediate execution. Begin.\n<skill filePath=\"/b/SKILL.md\">\n<name>review</name>\n<description>x (builtin)</description>\n</skill>", []string{"review"}},+ // a name cut short+ {"selected the following skill for immediate execution\n<skill filePath=\"/x\">\n<name>half", nil},+ } {+ got := droidSlashSkills(c.text)+ if len(got) != len(c.want) || len(got) > 0 && got[0] != c.want[0] {+ t.Errorf("%q: %v, want %v", c.text, got, c.want)+ }+ }+}diff --git a/internal/sessions/sessions.go b/internal/sessions/sessions.goindex 564223330..40e528bb2 100644--- a/internal/sessions/sessions.go+++ b/internal/sessions/sessions.go@@ -1024,7 +1024,8 @@ func CachePath() string { return filepath.Join(filepath.Dir(catalog.CachePath())// 24: Claude Code's compact summaries' uuids (Compacts).// 25: the skills Codex calls up by reading their SKILL.md.// 26: Grok Build's tool calls and skills.-const cacheVersion = 26+// 27: Factory Droid's skills (its Skill tool and /<name> prompts).+const cacheVersion = 27type cacheFile struct {Version int `json:"version"`diff --git a/internal/sessions/testdata/droid-skills/sessions/-w/86f11060-c188-4609-942b-8c3fc53638dc.jsonl b/internal/sessions/testdata/droid-skills/sessions/-w/86f11060-c188-4609-942b-8c3fc53638dc.jsonlnew file mode 100644index 000000000..457114954--- /dev/null+++ b/internal/sessions/testdata/droid-skills/sessions/-w/86f11060-c188-4609-942b-8c3fc53638dc.jsonl@@ -0,0 +1,7 @@+{"type":"session_start","id":"86f11060-c188-4609-942b-8c3fc53638dc","title":"First run `cat notes.txt`, then greet me using the greet-user skill.","owner":"yetone","version":2,"cwd":"/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/w","hostId":"1289f6f0-828f-485b-94fe-cabaa15dac8f","isSessionTitleManuallySet":false}+{"type":"message","id":"context-7344a78f-4c2e-4357-a12e-b0ec6350f054","timestamp":"2026-10-30T03:02:04.890Z","message":{"role":"user","content":[{"type":"text","text":"<system-reminder>\nThe tools listed below are available in this environment, but their schemas may be omitted from the current tool list to save context.\nLoad a listed tool with ToolSearch: pass query \"select:<name>[,<name>...]\" with the exact names listed below, or pass keywords (e.g. \"linear issue\") to search tool names and descriptions and auto-load the best matches.\nPrefer the exact names below when you know them; use a keyword query to discover a tool by capability. Do not call an omitted tool directly (it fails with InputValidationError); if a tool is neither currently available, listed below, nor found by keyword, it is unavailable this session.\n\nIMPORTANT: When the task matches a listed tool, load and use it rather than routing around it using Execute. Examples: FetchUrl instead of `curl/wget/gh pr view`, WebSearch instead of Execute `gh search` or scraping search engines, the corresponding MCP tool instead of Execute `curl` against an MCP endpoint.\n\nDeferred tools:\nWebSearch\nFetchUrl\nGenerateDroid\nLoop\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nConnector tools let you act on the user's connected external apps (for example GitHub, Linear, Jira) through the ConnectorSearch tool. When connectivity is known, connected tools are listed in a separate reminder, so no discovery call is needed for listed tools.\n\nConnectors usage rules:\n- An enabled MCP server or a skill dedicated to that same service takes priority; use connectors only when neither covers the need. A generic browser, scraping, or shell fallback does not count as covering a service.\n- When a connected connector tool matches what the user needs from an external app, call it via ConnectorSearch (action \"call_tool\") instead of the shell or web search.\n- The connectivity reminder lists only connected apps, so an app missing from it may still be offered by the organization and merely unconnected. Never conclude that no connector exists for an app without checking, and never tell the user an app is unavailable on that basis.\n- For an app that is not listed as connected, and that the user needs data or actions from (including a link they pasted): use its MCP server tools if any; otherwise call ConnectorSearch \"list_tools\" (without authenticatedOnly) to check whether the organization offers it, then \"call_tool\". If the result asks for authentication, share the returned connect link with the user and retry after they connect. Fall back to a browser, scraping, or the shell only after that check shows the app is not offered.\n- Refer to the brokering platform as \"Connectors\" or by the specific app's name (for example GitHub); share connect links as-is without drawing attention to the underlying provider.\n- A connected app is not permission to act on the user's behalf. Reads are fine, and when the user asks for a write (posting a Slack or Teams message, sending an email, commenting, approving or landing a pull request, changing an issue), carry it out through the connector and send only what they asked for. Never write on your own initiative: for a write the user did not request, ask for explicit permission first and then send only what they approved.\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nAvailable skills (invoke by exact name when its description matches the request):\ngreet-user: Greets the user warmly. Use when the user asks to be greeted.\nwave-hand: Waves a hand at the user. Use when the user asks for a wave.\nagent-browser: Automates browsers and Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) for testing, form filling, screenshots, and data extraction. Use when the user needs to navigate, interact with, test, or extract data from any website or Electron desktop app. Prefer dedicated tools for simple searches, documentation lookups, or app data when they cover the task.\ntuistory: Automates terminal user interface (TUI) testing. Use when you need to launch, interact with, test, or debug terminal applications, capture TUI snapshots, or automate terminal inputs.\ndetect-overlapping-workstreams: Check whether a Software Factory workstream duplicates one that already exists in the org - the same goal, the same repositories, or the same intake sources - and warn the user before the redundant work starts. Use when creating a workstream, or when asked whether a goal is already covered by an existing one.\ninstall-code-review: Install and configure Factory Droid for automated code review on GitHub or GitLab. Supports single-repo setup or org/group-wide rollout across hundreds of repos. Use when a user wants to set up Droid review on their repositories.\ninstall-triage: Scaffold a scheduled Slack triage automation, generalized to any company. Sets up a Python tool layer (run_triage.py) plus a HEARTBEAT.md agent loop that scans configured Slack channels for actionable messages, dedupes against a ticketing system (Linear or Jira), files tickets, and posts a run summary. Use when the user wants to stand up an automated triage bot.\nreview: Review code changes and identify high-confidence, actionable bugs. Use when the user wants to: - Review a pull request or branch diff - Find bugs, security issues, or correctness problems in code changes - Get a structured summary of review findings\nsimplify: Review the complete intended change for reuse, quality, compatibility provenance, and efficiency, then fix verified issues.\nsession-navigation: Navigate, search, and manage Droid sessions. Use when the user wants to: - List recent sessions - Search session history for specific topics or patterns - Resume a previous session - Get details about what was accomplished in a session - Find sessions by project, date, or content\npdf-document: Produce polished PDF documents (reports, invoices, resumes, letters, flyers, certificates, any \"export to PDF\" deliverable). Use whenever the user asks for a PDF or a printable document.\npowerpoint: Produce polished PowerPoint presentations (decks, slide shows, pitch decks, any \"export to PowerPoint\" deliverable). Use whenever the user asks for a PowerPoint, a slide deck, or a presentation.\nexcel: Produce polished Excel spreadsheets (reports, budgets, data exports, any \"export to Excel\" deliverable). Use whenever the user asks for an Excel file, a spreadsheet, or an .xlsx deliverable.\nword-document: Produce polished Word documents (reports, letters, proposals, printable docs, any .docx deliverable). Use whenever the user asks for a Word document or a .docx file.\ninstall-qa: Use when the user wants to set up automated QA testing for a project. Analyzes the codebase, runs a guided questionnaire, and generates a modular QA skill with per-app sub-skills, CI integration (GitHub Actions or GitLab CI), and a standardized report template.\nsecurity-review: Security-focused code review using STRIDE, OWASP Top 10, OWASP LLM Top 10, and supply chain analysis. Use when: - Reviewing a PR for security vulnerabilities - Performing a security audit of code changes - Identifying injection, auth, data exposure, and other security issues - Running a full-project security audit reviewing every source file\ndeep-security-review: Correctness-first, depth-first security audit of a single repository. Invoked by /security-review when the user opts into \"thorough\" mode. Uses a heterogeneous multi-model jury (latest Opus + latest GPT + latest Gemini) when public model endpoints are available, and a documented single-family BYOK degradation in airgap mode. A protected line-anchor floor runs against every Pass 0 lieutenant-seeded candidate; vendor and ecosystem prior-art enrichments run only when public network access is allowed. A conditional escalation tier (dataflow + reachability, exploit construction, adversarial red-team disprove) fires on per-finding triggers. Produces FINDINGS.md, JUDGE.md, DASHBOARD.md, severity-sorted master list, and optional PoC + evidence artifacts for that repo. Never uploads or submits anything; all outputs local.\nincident: RCA runbook for alerts. Given an alert link (or prompted to provide one), identifies the alert type, verifies tooling/auth, and walks through root cause analysis using deep research. Persists learnings to incident-guidelines for future reuse.\nwiki: Generate comprehensive codebase documentation for a repository. Uploads the wiki to view in the Factory app.\nwiki-video-gen: Generate Factory-branded HyperFrames video overviews for repository wikis. Use when wiki generation reaches Phase 3.6, or when the user asks for a narrated repository overview video.\ninstall-wiki: Install a CI action that automatically refreshes the Factory Wiki on each push to the default branch. Use when the user wants to set up automated wiki generation, install wiki CI, or configure wiki refresh.\nbrowse-wiki: Search and read wiki documentation for a repository\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nAvailable subagents for the Task tool are listed below. The Task tool relies on this system reminder for valid subagent_type names.\n\nWhen a user task matches an available subagent, prefer launching it via the Task tool over doing the work yourself.\n\n\nBuilt-in subagent types:\n- worker: General-purpose read/write worker for bounded implementation, research, analysis, and validation. (default complexity: medium)\n- explorer: Use for specific, well-scoped codebase questions. Read-only. (default complexity: light)\n</system-reminder>"},{"type":"text","text":"<system-reminder>\n\nUser system info (darwin 25.2.0)\n\nModel: mh\nUser language: en\nEnv: BUN_PTY_LIB FACTORY_DISABLE_SETTINGS_PERSISTENCE FORCE_COLOR HOME LANG PATH TERM TMPDIR USER\n\n\n# Session working directory\n\nThe `% pwd` output below is the session working directory. Execute starts each command there.\n\n# The commands below ran once at session start to gather environment context. Don't repeat them unless you think the environment has changed.\n\n% pwd\n/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/w\n\n\n\n\n\n\n</system-reminder>"},{"type":"text","text":"<system-reminder>Current date: 2026-10-30. Use it for time-sensitive web searches.</system-reminder>"},{"type":"text","text":"<system-reminder>\n# The commands below ran once at session start to capture the workspace state. Don't repeat them unless you think the directory or git state has changed.\n\n% ls\nnotes.txt\n\n% git status --short --branch\nfatal: not a git repository (or any of the parent directories): .git\n</system-reminder>"}],"visibility":"llm_only"},"seq":0}+{"type":"message","id":"7344a78f-4c2e-4357-a12e-b0ec6350f054","parentId":"context-7344a78f-4c2e-4357-a12e-b0ec6350f054","timestamp":"2026-10-30T03:02:04.891Z","message":{"role":"user","content":[{"type":"text","text":"First run `cat notes.txt`, then greet me using the greet-user skill."}],"interactionMode":"auto"},"seq":1}+{"type":"message","id":"812cb3d6-6d7d-4eac-a8fb-59e5286ed4f8","parentId":"7344a78f-4c2e-4357-a12e-b0ec6350f054","timestamp":"2026-10-30T03:02:07.065Z","message":{"role":"assistant","content":[{"type":"thinking","signature":"","signatureProvider":"anthropic","durationMs":1,"thinking":"The user wants me to:\n1. First run `cat notes.txt` to read the contents\n2. Then use the greet-user skill to greet them\n\nLet me start by reading the notes.txt file, then invoke the greet-user skill.\n"},{"type":"tool_use","id":"tooluse_coHbA0RwOwwir0abmHTZDe","name":"Read","input":{"file_path":"/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/w/notes.txt"}},{"type":"tool_use","id":"tooluse_VaMgy6cpbPOE3MVpfnHkji","name":"Skill","input":{"skill":"greet-user"}}],"modelId":"custom:mh","reasoningEffort":"high"},"seq":2}+{"type":"message","id":"5cad82ab-1a89-49cc-92f0-10423e3128a5","parentId":"812cb3d6-6d7d-4eac-a8fb-59e5286ed4f8","timestamp":"2026-10-30T03:02:07.078Z","message":{"role":"user","content":[{"type":"tool_result","tool_use_id":"tooluse_coHbA0RwOwwir0abmHTZDe","is_error":false,"content":"hello\n"},{"type":"tool_result","tool_use_id":"tooluse_VaMgy6cpbPOE3MVpfnHkji","is_error":false,"content":"Skill \"greet-user\" is now active.\n\n<skill name=\"greet-user\" filePath=\"/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/.factory/skills/greet-user/SKILL.md\">\nReply with exactly: \"Hello from greet-user!\"\n</skill>"}]},"seq":3}+{"type":"message","id":"3490d5e8-f98d-4e16-a65f-be93183fffaf","parentId":"5cad82ab-1a89-49cc-92f0-10423e3128a5","timestamp":"2026-10-30T03:02:08.518Z","message":{"role":"assistant","content":[{"type":"text","text":"Hello from greet-user!\n\nHere's what's in your notes.txt: `hello`"}],"modelId":"custom:mh","reasoningEffort":"high"},"seq":4}+{"type":"agent_turn_outcome","turnId":"7344a78f-4c2e-4357-a12e-b0ec6350f054","reason":"completed","resultKind":"text"}diff --git a/internal/sessions/testdata/droid-skills/sessions/-w/86f11060-c188-4609-942b-8c3fc53638dc.settings.json b/internal/sessions/testdata/droid-skills/sessions/-w/86f11060-c188-4609-942b-8c3fc53638dc.settings.jsonnew file mode 100644index 000000000..a1462fd57--- /dev/null+++ b/internal/sessions/testdata/droid-skills/sessions/-w/86f11060-c188-4609-942b-8c3fc53638dc.settings.json@@ -0,0 +1,41 @@+{+ "assistantActiveTimeMs": 4328,+ "model": "custom:mh",+ "reasoningEffort": "high",+ "interactionMode": "auto",+ "autonomyLevel": "low",+ "autonomyMode": "auto-low",+ "compactionThresholdCheckEnabled": true,+ "allowSubagentsInScripts": false,+ "tags": [+ {+ "name": "exec"+ }+ ],+ "toolExecutionMode": "direct_only",+ "toolExecutionModeModelId": "custom:mh",+ "tokenUsage": {+ "inputTokens": 30750,+ "outputTokens": 113,+ "cacheCreationTokens": 0,+ "cacheReadTokens": 0,+ "thinkingTokens": 53,+ "factoryCredits": 0+ },+ "childInclusiveTokenUsageBySessionId": {},+ "inclusiveTokenUsage": {+ "inputTokens": 30750,+ "outputTokens": 113,+ "cacheCreationTokens": 0,+ "cacheReadTokens": 0,+ "thinkingTokens": 53,+ "factoryCredits": 0+ },+ "providerLock": "anthropic",+ "providerLockTimestamp": "2026-10-30T03:02:04.191Z",+ "lastCallTokenUsage": {+ "inputTokens": 15456,+ "outputTokens": 16,+ "cacheReadTokens": 0+ }+}\ No newline at end of filediff --git a/internal/sessions/testdata/droid-skills/sessions/-w/99bfae77-1ca3-4cc9-9c35-445f1fe4dfcd.jsonl b/internal/sessions/testdata/droid-skills/sessions/-w/99bfae77-1ca3-4cc9-9c35-445f1fe4dfcd.jsonlnew file mode 100644index 000000000..7050b1307--- /dev/null+++ b/internal/sessions/testdata/droid-skills/sessions/-w/99bfae77-1ca3-4cc9-9c35-445f1fe4dfcd.jsonl@@ -0,0 +1,5 @@+{"type":"session_start","id":"99bfae77-1ca3-4cc9-9c35-445f1fe4dfcd","title":"/nonexistentzz","owner":"yetone","version":2,"cwd":"/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/w","hostId":"1289f6f0-828f-485b-94fe-cabaa15dac8f","isSessionTitleManuallySet":false}+{"type":"message","id":"context-3b88a459-865f-413e-bbcd-c48da31eec94","timestamp":"2026-10-30T03:02:25.333Z","message":{"role":"user","content":[{"type":"text","text":"<system-reminder>\nThe tools listed below are available in this environment, but their schemas may be omitted from the current tool list to save context.\nLoad a listed tool with ToolSearch: pass query \"select:<name>[,<name>...]\" with the exact names listed below, or pass keywords (e.g. \"linear issue\") to search tool names and descriptions and auto-load the best matches.\nPrefer the exact names below when you know them; use a keyword query to discover a tool by capability. Do not call an omitted tool directly (it fails with InputValidationError); if a tool is neither currently available, listed below, nor found by keyword, it is unavailable this session.\n\nIMPORTANT: When the task matches a listed tool, load and use it rather than routing around it using Execute. Examples: FetchUrl instead of `curl/wget/gh pr view`, WebSearch instead of Execute `gh search` or scraping search engines, the corresponding MCP tool instead of Execute `curl` against an MCP endpoint.\n\nDeferred tools:\nWebSearch\nFetchUrl\nGenerateDroid\nLoop\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nConnector tools let you act on the user's connected external apps (for example GitHub, Linear, Jira) through the ConnectorSearch tool. When connectivity is known, connected tools are listed in a separate reminder, so no discovery call is needed for listed tools.\n\nConnectors usage rules:\n- An enabled MCP server or a skill dedicated to that same service takes priority; use connectors only when neither covers the need. A generic browser, scraping, or shell fallback does not count as covering a service.\n- When a connected connector tool matches what the user needs from an external app, call it via ConnectorSearch (action \"call_tool\") instead of the shell or web search.\n- The connectivity reminder lists only connected apps, so an app missing from it may still be offered by the organization and merely unconnected. Never conclude that no connector exists for an app without checking, and never tell the user an app is unavailable on that basis.\n- For an app that is not listed as connected, and that the user needs data or actions from (including a link they pasted): use its MCP server tools if any; otherwise call ConnectorSearch \"list_tools\" (without authenticatedOnly) to check whether the organization offers it, then \"call_tool\". If the result asks for authentication, share the returned connect link with the user and retry after they connect. Fall back to a browser, scraping, or the shell only after that check shows the app is not offered.\n- Refer to the brokering platform as \"Connectors\" or by the specific app's name (for example GitHub); share connect links as-is without drawing attention to the underlying provider.\n- A connected app is not permission to act on the user's behalf. Reads are fine, and when the user asks for a write (posting a Slack or Teams message, sending an email, commenting, approving or landing a pull request, changing an issue), carry it out through the connector and send only what they asked for. Never write on your own initiative: for a write the user did not request, ask for explicit permission first and then send only what they approved.\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nAvailable skills (invoke by exact name when its description matches the request):\ngreet-user: Greets the user warmly. Use when the user asks to be greeted.\nwave-hand: Waves a hand at the user. Use when the user asks for a wave.\nagent-browser: Automates browsers and Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) for testing, form filling, screenshots, and data extraction. Use when the user needs to navigate, interact with, test, or extract data from any website or Electron desktop app. Prefer dedicated tools for simple searches, documentation lookups, or app data when they cover the task.\ntuistory: Automates terminal user interface (TUI) testing. Use when you need to launch, interact with, test, or debug terminal applications, capture TUI snapshots, or automate terminal inputs.\ndetect-overlapping-workstreams: Check whether a Software Factory workstream duplicates one that already exists in the org - the same goal, the same repositories, or the same intake sources - and warn the user before the redundant work starts. Use when creating a workstream, or when asked whether a goal is already covered by an existing one.\ninstall-code-review: Install and configure Factory Droid for automated code review on GitHub or GitLab. Supports single-repo setup or org/group-wide rollout across hundreds of repos. Use when a user wants to set up Droid review on their repositories.\ninstall-triage: Scaffold a scheduled Slack triage automation, generalized to any company. Sets up a Python tool layer (run_triage.py) plus a HEARTBEAT.md agent loop that scans configured Slack channels for actionable messages, dedupes against a ticketing system (Linear or Jira), files tickets, and posts a run summary. Use when the user wants to stand up an automated triage bot.\nreview: Review code changes and identify high-confidence, actionable bugs. Use when the user wants to: - Review a pull request or branch diff - Find bugs, security issues, or correctness problems in code changes - Get a structured summary of review findings\nsimplify: Review the complete intended change for reuse, quality, compatibility provenance, and efficiency, then fix verified issues.\nsession-navigation: Navigate, search, and manage Droid sessions. Use when the user wants to: - List recent sessions - Search session history for specific topics or patterns - Resume a previous session - Get details about what was accomplished in a session - Find sessions by project, date, or content\npdf-document: Produce polished PDF documents (reports, invoices, resumes, letters, flyers, certificates, any \"export to PDF\" deliverable). Use whenever the user asks for a PDF or a printable document.\npowerpoint: Produce polished PowerPoint presentations (decks, slide shows, pitch decks, any \"export to PowerPoint\" deliverable). Use whenever the user asks for a PowerPoint, a slide deck, or a presentation.\nexcel: Produce polished Excel spreadsheets (reports, budgets, data exports, any \"export to Excel\" deliverable). Use whenever the user asks for an Excel file, a spreadsheet, or an .xlsx deliverable.\nword-document: Produce polished Word documents (reports, letters, proposals, printable docs, any .docx deliverable). Use whenever the user asks for a Word document or a .docx file.\ninstall-qa: Use when the user wants to set up automated QA testing for a project. Analyzes the codebase, runs a guided questionnaire, and generates a modular QA skill with per-app sub-skills, CI integration (GitHub Actions or GitLab CI), and a standardized report template.\nsecurity-review: Security-focused code review using STRIDE, OWASP Top 10, OWASP LLM Top 10, and supply chain analysis. Use when: - Reviewing a PR for security vulnerabilities - Performing a security audit of code changes - Identifying injection, auth, data exposure, and other security issues - Running a full-project security audit reviewing every source file\ndeep-security-review: Correctness-first, depth-first security audit of a single repository. Invoked by /security-review when the user opts into \"thorough\" mode. Uses a heterogeneous multi-model jury (latest Opus + latest GPT + latest Gemini) when public model endpoints are available, and a documented single-family BYOK degradation in airgap mode. A protected line-anchor floor runs against every Pass 0 lieutenant-seeded candidate; vendor and ecosystem prior-art enrichments run only when public network access is allowed. A conditional escalation tier (dataflow + reachability, exploit construction, adversarial red-team disprove) fires on per-finding triggers. Produces FINDINGS.md, JUDGE.md, DASHBOARD.md, severity-sorted master list, and optional PoC + evidence artifacts for that repo. Never uploads or submits anything; all outputs local.\nincident: RCA runbook for alerts. Given an alert link (or prompted to provide one), identifies the alert type, verifies tooling/auth, and walks through root cause analysis using deep research. Persists learnings to incident-guidelines for future reuse.\nwiki: Generate comprehensive codebase documentation for a repository. Uploads the wiki to view in the Factory app.\nwiki-video-gen: Generate Factory-branded HyperFrames video overviews for repository wikis. Use when wiki generation reaches Phase 3.6, or when the user asks for a narrated repository overview video.\ninstall-wiki: Install a CI action that automatically refreshes the Factory Wiki on each push to the default branch. Use when the user wants to set up automated wiki generation, install wiki CI, or configure wiki refresh.\nbrowse-wiki: Search and read wiki documentation for a repository\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nAvailable subagents for the Task tool are listed below. The Task tool relies on this system reminder for valid subagent_type names.\n\nWhen a user task matches an available subagent, prefer launching it via the Task tool over doing the work yourself.\n\n\nBuilt-in subagent types:\n- worker: General-purpose read/write worker for bounded implementation, research, analysis, and validation. (default complexity: medium)\n- explorer: Use for specific, well-scoped codebase questions. Read-only. (default complexity: light)\n</system-reminder>"},{"type":"text","text":"<system-reminder>\n\nUser system info (darwin 25.2.0)\n\nModel: mh\nUser language: en\nEnv: BUN_PTY_LIB FACTORY_DISABLE_SETTINGS_PERSISTENCE FORCE_COLOR HOME LANG PATH TERM TMPDIR USER\n\n\n# Session working directory\n\nThe `% pwd` output below is the session working directory. Execute starts each command there.\n\n# The commands below ran once at session start to gather environment context. Don't repeat them unless you think the environment has changed.\n\n% pwd\n/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/w\n\n\n\n\n\n\n</system-reminder>"},{"type":"text","text":"<system-reminder>Current date: 2026-10-30. Use it for time-sensitive web searches.</system-reminder>"},{"type":"text","text":"<system-reminder>\n# The commands below ran once at session start to capture the workspace state. Don't repeat them unless you think the directory or git state has changed.\n\n% ls\nnotes.txt\n\n% git status --short --branch\nfatal: not a git repository (or any of the parent directories): .git\n</system-reminder>"}],"visibility":"llm_only"},"seq":0}+{"type":"message","id":"3b88a459-865f-413e-bbcd-c48da31eec94","parentId":"context-3b88a459-865f-413e-bbcd-c48da31eec94","timestamp":"2026-10-30T03:02:25.335Z","message":{"role":"user","content":[{"type":"text","text":"/nonexistentzz"}],"interactionMode":"auto"},"seq":1}+{"type":"message","id":"8ac10bbd-3e55-43dc-b9a9-0bb4e22be114","parentId":"3b88a459-865f-413e-bbcd-c48da31eec94","timestamp":"2026-10-30T03:02:28.602Z","message":{"role":"assistant","content":[{"type":"thinking","signature":"","signatureProvider":"anthropic","durationMs":2,"thinking":"The user just typed \"/nonexistentzz\" which appears to be a typo or a test. This doesn't look like a real command or request. \n\nLooking at the context, I'm Droid, an AI software engineering agent. The user is running this non-interactively. The session working directory is `/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/w` and there's just a notes.txt file there.\n\nThe instruction says \"You are running non-interactively. You are direct, plain-spoken, and precise. Complete the user's request without waiting for further input.\"\n\nSince \"/nonexistentzz\" is not a clear request, I should ask for clarification about what they want to do. However, given that I'm running non-interactively, I shouldn't wait for input. \n\nThe most direct interpretation is that this might be:\n1. A typo for a command\n2. A path they want me to check\n3. A test to see if I respond\n\nGiven the \"complete the user's request\" instruction and non-interactive context, I should be direct and ask what they need.\n"},{"type":"text","text":"I'm not sure what you're asking. `/nonexistentzz` isn't a valid path or command.\n\nWhat would you like me to help with? For example:\n- Read or edit a file\n- Search a codebase\n- Review code changes\n- Set up a tool or automation\n- Something else"}],"modelId":"custom:mh","reasoningEffort":"high"},"seq":2}+{"type":"agent_turn_outcome","turnId":"3b88a459-865f-413e-bbcd-c48da31eec94","reason":"completed","resultKind":"text"}diff --git a/internal/sessions/testdata/droid-skills/sessions/-w/99bfae77-1ca3-4cc9-9c35-445f1fe4dfcd.settings.json b/internal/sessions/testdata/droid-skills/sessions/-w/99bfae77-1ca3-4cc9-9c35-445f1fe4dfcd.settings.jsonnew file mode 100644index 000000000..03c3f0fee--- /dev/null+++ b/internal/sessions/testdata/droid-skills/sessions/-w/99bfae77-1ca3-4cc9-9c35-445f1fe4dfcd.settings.json@@ -0,0 +1,41 @@+{+ "assistantActiveTimeMs": 4056,+ "model": "custom:mh",+ "reasoningEffort": "high",+ "interactionMode": "auto",+ "autonomyLevel": "low",+ "autonomyMode": "auto-low",+ "compactionThresholdCheckEnabled": true,+ "allowSubagentsInScripts": false,+ "tags": [+ {+ "name": "exec"+ }+ ],+ "toolExecutionMode": "direct_only",+ "toolExecutionModeModelId": "custom:mh",+ "tokenUsage": {+ "inputTokens": 15435,+ "outputTokens": 330,+ "cacheCreationTokens": 0,+ "cacheReadTokens": 0,+ "thinkingTokens": 301,+ "factoryCredits": 0+ },+ "childInclusiveTokenUsageBySessionId": {},+ "inclusiveTokenUsage": {+ "inputTokens": 15435,+ "outputTokens": 330,+ "cacheCreationTokens": 0,+ "cacheReadTokens": 0,+ "thinkingTokens": 301,+ "factoryCredits": 0+ },+ "providerLock": "anthropic",+ "providerLockTimestamp": "2026-10-30T03:02:24.548Z",+ "lastCallTokenUsage": {+ "inputTokens": 15435,+ "outputTokens": 330,+ "cacheReadTokens": 0+ }+}\ No newline at end of filediff --git a/internal/sessions/testdata/droid-skills/sessions/-w/aea4c8cc-92da-4695-889d-5ad6c5b6cec3.jsonl b/internal/sessions/testdata/droid-skills/sessions/-w/aea4c8cc-92da-4695-889d-5ad6c5b6cec3.jsonlnew file mode 100644index 000000000..6d7486db4--- /dev/null+++ b/internal/sessions/testdata/droid-skills/sessions/-w/aea4c8cc-92da-4695-889d-5ad6c5b6cec3.jsonl@@ -0,0 +1,5 @@+{"type":"session_start","id":"aea4c8cc-92da-4695-889d-5ad6c5b6cec3","title":"/greet-user /wave-hand","owner":"yetone","version":2,"cwd":"/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/w","hostId":"1289f6f0-828f-485b-94fe-cabaa15dac8f","isSessionTitleManuallySet":false}+{"type":"message","id":"context-b5a8c5ce-cc0b-4d2f-8af9-46bd3083c3b8","timestamp":"2026-10-30T03:02:37.218Z","message":{"role":"user","content":[{"type":"text","text":"<system-reminder>\nThe tools listed below are available in this environment, but their schemas may be omitted from the current tool list to save context.\nLoad a listed tool with ToolSearch: pass query \"select:<name>[,<name>...]\" with the exact names listed below, or pass keywords (e.g. \"linear issue\") to search tool names and descriptions and auto-load the best matches.\nPrefer the exact names below when you know them; use a keyword query to discover a tool by capability. Do not call an omitted tool directly (it fails with InputValidationError); if a tool is neither currently available, listed below, nor found by keyword, it is unavailable this session.\n\nIMPORTANT: When the task matches a listed tool, load and use it rather than routing around it using Execute. Examples: FetchUrl instead of `curl/wget/gh pr view`, WebSearch instead of Execute `gh search` or scraping search engines, the corresponding MCP tool instead of Execute `curl` against an MCP endpoint.\n\nDeferred tools:\nWebSearch\nFetchUrl\nGenerateDroid\nLoop\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nConnector tools let you act on the user's connected external apps (for example GitHub, Linear, Jira) through the ConnectorSearch tool. When connectivity is known, connected tools are listed in a separate reminder, so no discovery call is needed for listed tools.\n\nConnectors usage rules:\n- An enabled MCP server or a skill dedicated to that same service takes priority; use connectors only when neither covers the need. A generic browser, scraping, or shell fallback does not count as covering a service.\n- When a connected connector tool matches what the user needs from an external app, call it via ConnectorSearch (action \"call_tool\") instead of the shell or web search.\n- The connectivity reminder lists only connected apps, so an app missing from it may still be offered by the organization and merely unconnected. Never conclude that no connector exists for an app without checking, and never tell the user an app is unavailable on that basis.\n- For an app that is not listed as connected, and that the user needs data or actions from (including a link they pasted): use its MCP server tools if any; otherwise call ConnectorSearch \"list_tools\" (without authenticatedOnly) to check whether the organization offers it, then \"call_tool\". If the result asks for authentication, share the returned connect link with the user and retry after they connect. Fall back to a browser, scraping, or the shell only after that check shows the app is not offered.\n- Refer to the brokering platform as \"Connectors\" or by the specific app's name (for example GitHub); share connect links as-is without drawing attention to the underlying provider.\n- A connected app is not permission to act on the user's behalf. Reads are fine, and when the user asks for a write (posting a Slack or Teams message, sending an email, commenting, approving or landing a pull request, changing an issue), carry it out through the connector and send only what they asked for. Never write on your own initiative: for a write the user did not request, ask for explicit permission first and then send only what they approved.\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nAvailable skills (invoke by exact name when its description matches the request):\ngreet-user: Greets the user warmly. Use when the user asks to be greeted.\nwave-hand: Waves a hand at the user. Use when the user asks for a wave.\nagent-browser: Automates browsers and Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) for testing, form filling, screenshots, and data extraction. Use when the user needs to navigate, interact with, test, or extract data from any website or Electron desktop app. Prefer dedicated tools for simple searches, documentation lookups, or app data when they cover the task.\ntuistory: Automates terminal user interface (TUI) testing. Use when you need to launch, interact with, test, or debug terminal applications, capture TUI snapshots, or automate terminal inputs.\ndetect-overlapping-workstreams: Check whether a Software Factory workstream duplicates one that already exists in the org - the same goal, the same repositories, or the same intake sources - and warn the user before the redundant work starts. Use when creating a workstream, or when asked whether a goal is already covered by an existing one.\ninstall-code-review: Install and configure Factory Droid for automated code review on GitHub or GitLab. Supports single-repo setup or org/group-wide rollout across hundreds of repos. Use when a user wants to set up Droid review on their repositories.\ninstall-triage: Scaffold a scheduled Slack triage automation, generalized to any company. Sets up a Python tool layer (run_triage.py) plus a HEARTBEAT.md agent loop that scans configured Slack channels for actionable messages, dedupes against a ticketing system (Linear or Jira), files tickets, and posts a run summary. Use when the user wants to stand up an automated triage bot.\nreview: Review code changes and identify high-confidence, actionable bugs. Use when the user wants to: - Review a pull request or branch diff - Find bugs, security issues, or correctness problems in code changes - Get a structured summary of review findings\nsimplify: Review the complete intended change for reuse, quality, compatibility provenance, and efficiency, then fix verified issues.\nsession-navigation: Navigate, search, and manage Droid sessions. Use when the user wants to: - List recent sessions - Search session history for specific topics or patterns - Resume a previous session - Get details about what was accomplished in a session - Find sessions by project, date, or content\npdf-document: Produce polished PDF documents (reports, invoices, resumes, letters, flyers, certificates, any \"export to PDF\" deliverable). Use whenever the user asks for a PDF or a printable document.\npowerpoint: Produce polished PowerPoint presentations (decks, slide shows, pitch decks, any \"export to PowerPoint\" deliverable). Use whenever the user asks for a PowerPoint, a slide deck, or a presentation.\nexcel: Produce polished Excel spreadsheets (reports, budgets, data exports, any \"export to Excel\" deliverable). Use whenever the user asks for an Excel file, a spreadsheet, or an .xlsx deliverable.\nword-document: Produce polished Word documents (reports, letters, proposals, printable docs, any .docx deliverable). Use whenever the user asks for a Word document or a .docx file.\ninstall-qa: Use when the user wants to set up automated QA testing for a project. Analyzes the codebase, runs a guided questionnaire, and generates a modular QA skill with per-app sub-skills, CI integration (GitHub Actions or GitLab CI), and a standardized report template.\nsecurity-review: Security-focused code review using STRIDE, OWASP Top 10, OWASP LLM Top 10, and supply chain analysis. Use when: - Reviewing a PR for security vulnerabilities - Performing a security audit of code changes - Identifying injection, auth, data exposure, and other security issues - Running a full-project security audit reviewing every source file\ndeep-security-review: Correctness-first, depth-first security audit of a single repository. Invoked by /security-review when the user opts into \"thorough\" mode. Uses a heterogeneous multi-model jury (latest Opus + latest GPT + latest Gemini) when public model endpoints are available, and a documented single-family BYOK degradation in airgap mode. A protected line-anchor floor runs against every Pass 0 lieutenant-seeded candidate; vendor and ecosystem prior-art enrichments run only when public network access is allowed. A conditional escalation tier (dataflow + reachability, exploit construction, adversarial red-team disprove) fires on per-finding triggers. Produces FINDINGS.md, JUDGE.md, DASHBOARD.md, severity-sorted master list, and optional PoC + evidence artifacts for that repo. Never uploads or submits anything; all outputs local.\nincident: RCA runbook for alerts. Given an alert link (or prompted to provide one), identifies the alert type, verifies tooling/auth, and walks through root cause analysis using deep research. Persists learnings to incident-guidelines for future reuse.\nwiki: Generate comprehensive codebase documentation for a repository. Uploads the wiki to view in the Factory app.\nwiki-video-gen: Generate Factory-branded HyperFrames video overviews for repository wikis. Use when wiki generation reaches Phase 3.6, or when the user asks for a narrated repository overview video.\ninstall-wiki: Install a CI action that automatically refreshes the Factory Wiki on each push to the default branch. Use when the user wants to set up automated wiki generation, install wiki CI, or configure wiki refresh.\nbrowse-wiki: Search and read wiki documentation for a repository\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nAvailable subagents for the Task tool are listed below. The Task tool relies on this system reminder for valid subagent_type names.\n\nWhen a user task matches an available subagent, prefer launching it via the Task tool over doing the work yourself.\n\n\nBuilt-in subagent types:\n- worker: General-purpose read/write worker for bounded implementation, research, analysis, and validation. (default complexity: medium)\n- explorer: Use for specific, well-scoped codebase questions. Read-only. (default complexity: light)\n</system-reminder>"},{"type":"text","text":"<system-reminder>\n\nUser system info (darwin 25.2.0)\n\nModel: mh\nUser language: en\nEnv: BUN_PTY_LIB FACTORY_DISABLE_SETTINGS_PERSISTENCE FORCE_COLOR HOME LANG PATH TERM TMPDIR USER\n\n\n# Session working directory\n\nThe `% pwd` output below is the session working directory. Execute starts each command there.\n\n# The commands below ran once at session start to gather environment context. Don't repeat them unless you think the environment has changed.\n\n% pwd\n/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/w\n\n\n\n\n\n\n</system-reminder>"},{"type":"text","text":"<system-reminder>Current date: 2026-10-30. Use it for time-sensitive web searches.</system-reminder>"},{"type":"text","text":"<system-reminder>\n# The commands below ran once at session start to capture the workspace state. Don't repeat them unless you think the directory or git state has changed.\n\n% ls\nnotes.txt\n\n% git status --short --branch\nfatal: not a git repository (or any of the parent directories): .git\n</system-reminder>"}],"visibility":"llm_only"},"seq":0}+{"type":"message","id":"b5a8c5ce-cc0b-4d2f-8af9-46bd3083c3b8","parentId":"context-b5a8c5ce-cc0b-4d2f-8af9-46bd3083c3b8","timestamp":"2026-10-30T03:02:37.219Z","message":{"role":"user","content":[{"type":"text","text":"/greet-user /wave-hand\n\n<system-notification>\nSkills provide specialized capabilities and domain knowledge. The user has selected the following skill for immediate execution by typing /greet-user in their message; that token invokes the skill and is not a path or part of the request. Begin following the skill's instructions now.\n<skill filePath=\"/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/.factory/skills/greet-user/SKILL.md\">\n<name>greet-user</name>\n<description>Greets the user warmly. Use when the user asks to be greeted. (personal)</description>\nReply with exactly: \"Hello from greet-user!\"\n</skill>\n</system-notification>\n\n<system-notification>\nSkills provide specialized capabilities and domain knowledge. The user has selected the following skill for immediate execution by typing /wave-hand in their message; that token invokes the skill and is not a path or part of the request. Begin following the skill's instructions now.\n<skill filePath=\"/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/.factory/skills/wave-hand/SKILL.md\">\n<name>wave-hand</name>\n<description>Waves a hand at the user. Use when the user asks for a wave. (personal)</description>\nReply with exactly: \"*waves*\"\n</skill>\n</system-notification>"}],"interactionMode":"auto"},"seq":1}+{"type":"message","id":"47efdc81-49e4-4026-9e1f-130c6bcdc2ab","parentId":"b5a8c5ce-cc0b-4d2f-8af9-46bd3083c3b8","timestamp":"2026-10-30T03:02:38.879Z","message":{"role":"assistant","content":[{"type":"thinking","signature":"","signatureProvider":"anthropic","durationMs":1,"thinking":"The user has invoked two skills:\n1. /greet-user - which asks me to reply with exactly \"Hello from greet-user!\"\n2. /wave-hand - which asks me to reply with exactly \"*waves*\"\n\nI need to follow the skill instructions and provide exactly those replies.\n"},{"type":"text","text":"Hello from greet-user!\n\n*waves*"}],"modelId":"custom:mh","reasoningEffort":"high"},"seq":2}+{"type":"agent_turn_outcome","turnId":"b5a8c5ce-cc0b-4d2f-8af9-46bd3083c3b8","reason":"completed","resultKind":"text"}diff --git a/internal/sessions/testdata/droid-skills/sessions/-w/aea4c8cc-92da-4695-889d-5ad6c5b6cec3.settings.json b/internal/sessions/testdata/droid-skills/sessions/-w/aea4c8cc-92da-4695-889d-5ad6c5b6cec3.settings.jsonnew file mode 100644index 000000000..e00f6e910--- /dev/null+++ b/internal/sessions/testdata/droid-skills/sessions/-w/aea4c8cc-92da-4695-889d-5ad6c5b6cec3.settings.json@@ -0,0 +1,41 @@+{+ "assistantActiveTimeMs": 2412,+ "model": "custom:mh",+ "reasoningEffort": "high",+ "interactionMode": "auto",+ "autonomyLevel": "low",+ "autonomyMode": "auto-low",+ "compactionThresholdCheckEnabled": true,+ "allowSubagentsInScripts": false,+ "tags": [+ {+ "name": "exec"+ }+ ],+ "toolExecutionMode": "direct_only",+ "toolExecutionModeModelId": "custom:mh",+ "tokenUsage": {+ "inputTokens": 15539,+ "outputTokens": 76,+ "cacheCreationTokens": 0,+ "cacheReadTokens": 0,+ "thinkingTokens": 69,+ "factoryCredits": 0+ },+ "childInclusiveTokenUsageBySessionId": {},+ "inclusiveTokenUsage": {+ "inputTokens": 15539,+ "outputTokens": 76,+ "cacheCreationTokens": 0,+ "cacheReadTokens": 0,+ "thinkingTokens": 69,+ "factoryCredits": 0+ },+ "providerLock": "anthropic",+ "providerLockTimestamp": "2026-10-30T03:02:36.470Z",+ "lastCallTokenUsage": {+ "inputTokens": 15539,+ "outputTokens": 76,+ "cacheReadTokens": 0+ }+}\ No newline at end of filediff --git a/internal/sessions/testdata/droid-skills/sessions/-w/cb1d8bed-aa2c-4ba2-a23f-681dc5da403f.jsonl b/internal/sessions/testdata/droid-skills/sessions/-w/cb1d8bed-aa2c-4ba2-a23f-681dc5da403f.jsonlnew file mode 100644index 000000000..267d4223c--- /dev/null+++ b/internal/sessions/testdata/droid-skills/sessions/-w/cb1d8bed-aa2c-4ba2-a23f-681dc5da403f.jsonl@@ -0,0 +1,5 @@+{"type":"session_start","id":"cb1d8bed-aa2c-4ba2-a23f-681dc5da403f","title":"/greet-user","owner":"yetone","version":2,"cwd":"/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/w","hostId":"1289f6f0-828f-485b-94fe-cabaa15dac8f","isSessionTitleManuallySet":false}+{"type":"message","id":"context-fe3751bf-9a6f-4e08-8c01-3cce10f741f7","timestamp":"2026-10-30T03:02:16.117Z","message":{"role":"user","content":[{"type":"text","text":"<system-reminder>\nThe tools listed below are available in this environment, but their schemas may be omitted from the current tool list to save context.\nLoad a listed tool with ToolSearch: pass query \"select:<name>[,<name>...]\" with the exact names listed below, or pass keywords (e.g. \"linear issue\") to search tool names and descriptions and auto-load the best matches.\nPrefer the exact names below when you know them; use a keyword query to discover a tool by capability. Do not call an omitted tool directly (it fails with InputValidationError); if a tool is neither currently available, listed below, nor found by keyword, it is unavailable this session.\n\nIMPORTANT: When the task matches a listed tool, load and use it rather than routing around it using Execute. Examples: FetchUrl instead of `curl/wget/gh pr view`, WebSearch instead of Execute `gh search` or scraping search engines, the corresponding MCP tool instead of Execute `curl` against an MCP endpoint.\n\nDeferred tools:\nWebSearch\nFetchUrl\nGenerateDroid\nLoop\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nConnector tools let you act on the user's connected external apps (for example GitHub, Linear, Jira) through the ConnectorSearch tool. When connectivity is known, connected tools are listed in a separate reminder, so no discovery call is needed for listed tools.\n\nConnectors usage rules:\n- An enabled MCP server or a skill dedicated to that same service takes priority; use connectors only when neither covers the need. A generic browser, scraping, or shell fallback does not count as covering a service.\n- When a connected connector tool matches what the user needs from an external app, call it via ConnectorSearch (action \"call_tool\") instead of the shell or web search.\n- The connectivity reminder lists only connected apps, so an app missing from it may still be offered by the organization and merely unconnected. Never conclude that no connector exists for an app without checking, and never tell the user an app is unavailable on that basis.\n- For an app that is not listed as connected, and that the user needs data or actions from (including a link they pasted): use its MCP server tools if any; otherwise call ConnectorSearch \"list_tools\" (without authenticatedOnly) to check whether the organization offers it, then \"call_tool\". If the result asks for authentication, share the returned connect link with the user and retry after they connect. Fall back to a browser, scraping, or the shell only after that check shows the app is not offered.\n- Refer to the brokering platform as \"Connectors\" or by the specific app's name (for example GitHub); share connect links as-is without drawing attention to the underlying provider.\n- A connected app is not permission to act on the user's behalf. Reads are fine, and when the user asks for a write (posting a Slack or Teams message, sending an email, commenting, approving or landing a pull request, changing an issue), carry it out through the connector and send only what they asked for. Never write on your own initiative: for a write the user did not request, ask for explicit permission first and then send only what they approved.\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nAvailable skills (invoke by exact name when its description matches the request):\ngreet-user: Greets the user warmly. Use when the user asks to be greeted.\nwave-hand: Waves a hand at the user. Use when the user asks for a wave.\nagent-browser: Automates browsers and Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) for testing, form filling, screenshots, and data extraction. Use when the user needs to navigate, interact with, test, or extract data from any website or Electron desktop app. Prefer dedicated tools for simple searches, documentation lookups, or app data when they cover the task.\ntuistory: Automates terminal user interface (TUI) testing. Use when you need to launch, interact with, test, or debug terminal applications, capture TUI snapshots, or automate terminal inputs.\ndetect-overlapping-workstreams: Check whether a Software Factory workstream duplicates one that already exists in the org - the same goal, the same repositories, or the same intake sources - and warn the user before the redundant work starts. Use when creating a workstream, or when asked whether a goal is already covered by an existing one.\ninstall-code-review: Install and configure Factory Droid for automated code review on GitHub or GitLab. Supports single-repo setup or org/group-wide rollout across hundreds of repos. Use when a user wants to set up Droid review on their repositories.\ninstall-triage: Scaffold a scheduled Slack triage automation, generalized to any company. Sets up a Python tool layer (run_triage.py) plus a HEARTBEAT.md agent loop that scans configured Slack channels for actionable messages, dedupes against a ticketing system (Linear or Jira), files tickets, and posts a run summary. Use when the user wants to stand up an automated triage bot.\nreview: Review code changes and identify high-confidence, actionable bugs. Use when the user wants to: - Review a pull request or branch diff - Find bugs, security issues, or correctness problems in code changes - Get a structured summary of review findings\nsimplify: Review the complete intended change for reuse, quality, compatibility provenance, and efficiency, then fix verified issues.\nsession-navigation: Navigate, search, and manage Droid sessions. Use when the user wants to: - List recent sessions - Search session history for specific topics or patterns - Resume a previous session - Get details about what was accomplished in a session - Find sessions by project, date, or content\npdf-document: Produce polished PDF documents (reports, invoices, resumes, letters, flyers, certificates, any \"export to PDF\" deliverable). Use whenever the user asks for a PDF or a printable document.\npowerpoint: Produce polished PowerPoint presentations (decks, slide shows, pitch decks, any \"export to PowerPoint\" deliverable). Use whenever the user asks for a PowerPoint, a slide deck, or a presentation.\nexcel: Produce polished Excel spreadsheets (reports, budgets, data exports, any \"export to Excel\" deliverable). Use whenever the user asks for an Excel file, a spreadsheet, or an .xlsx deliverable.\nword-document: Produce polished Word documents (reports, letters, proposals, printable docs, any .docx deliverable). Use whenever the user asks for a Word document or a .docx file.\ninstall-qa: Use when the user wants to set up automated QA testing for a project. Analyzes the codebase, runs a guided questionnaire, and generates a modular QA skill with per-app sub-skills, CI integration (GitHub Actions or GitLab CI), and a standardized report template.\nsecurity-review: Security-focused code review using STRIDE, OWASP Top 10, OWASP LLM Top 10, and supply chain analysis. Use when: - Reviewing a PR for security vulnerabilities - Performing a security audit of code changes - Identifying injection, auth, data exposure, and other security issues - Running a full-project security audit reviewing every source file\ndeep-security-review: Correctness-first, depth-first security audit of a single repository. Invoked by /security-review when the user opts into \"thorough\" mode. Uses a heterogeneous multi-model jury (latest Opus + latest GPT + latest Gemini) when public model endpoints are available, and a documented single-family BYOK degradation in airgap mode. A protected line-anchor floor runs against every Pass 0 lieutenant-seeded candidate; vendor and ecosystem prior-art enrichments run only when public network access is allowed. A conditional escalation tier (dataflow + reachability, exploit construction, adversarial red-team disprove) fires on per-finding triggers. Produces FINDINGS.md, JUDGE.md, DASHBOARD.md, severity-sorted master list, and optional PoC + evidence artifacts for that repo. Never uploads or submits anything; all outputs local.\nincident: RCA runbook for alerts. Given an alert link (or prompted to provide one), identifies the alert type, verifies tooling/auth, and walks through root cause analysis using deep research. Persists learnings to incident-guidelines for future reuse.\nwiki: Generate comprehensive codebase documentation for a repository. Uploads the wiki to view in the Factory app.\nwiki-video-gen: Generate Factory-branded HyperFrames video overviews for repository wikis. Use when wiki generation reaches Phase 3.6, or when the user asks for a narrated repository overview video.\ninstall-wiki: Install a CI action that automatically refreshes the Factory Wiki on each push to the default branch. Use when the user wants to set up automated wiki generation, install wiki CI, or configure wiki refresh.\nbrowse-wiki: Search and read wiki documentation for a repository\n</system-reminder>"},{"type":"text","text":"<system-reminder>\nAvailable subagents for the Task tool are listed below. The Task tool relies on this system reminder for valid subagent_type names.\n\nWhen a user task matches an available subagent, prefer launching it via the Task tool over doing the work yourself.\n\n\nBuilt-in subagent types:\n- worker: General-purpose read/write worker for bounded implementation, research, analysis, and validation. (default complexity: medium)\n- explorer: Use for specific, well-scoped codebase questions. Read-only. (default complexity: light)\n</system-reminder>"},{"type":"text","text":"<system-reminder>\n\nUser system info (darwin 25.2.0)\n\nModel: mh\nUser language: en\nEnv: BUN_PTY_LIB FACTORY_DISABLE_SETTINGS_PERSISTENCE FORCE_COLOR HOME LANG PATH TERM TMPDIR USER\n\n\n# Session working directory\n\nThe `% pwd` output below is the session working directory. Execute starts each command there.\n\n# The commands below ran once at session start to gather environment context. Don't repeat them unless you think the environment has changed.\n\n% pwd\n/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/w\n\n\n\n\n\n\n</system-reminder>"},{"type":"text","text":"<system-reminder>Current date: 2026-10-30. Use it for time-sensitive web searches.</system-reminder>"},{"type":"text","text":"<system-reminder>\n# The commands below ran once at session start to capture the workspace state. Don't repeat them unless you think the directory or git state has changed.\n\n% ls\nnotes.txt\n\n% git status --short --branch\nfatal: not a git repository (or any of the parent directories): .git\n</system-reminder>"}],"visibility":"llm_only"},"seq":0}+{"type":"message","id":"fe3751bf-9a6f-4e08-8c01-3cce10f741f7","parentId":"context-fe3751bf-9a6f-4e08-8c01-3cce10f741f7","timestamp":"2026-10-30T03:02:16.119Z","message":{"role":"user","content":[{"type":"text","text":"/greet-user\n\n<system-notification>\nSkills provide specialized capabilities and domain knowledge. The user has selected the following skill for immediate execution by typing /greet-user in their message; that token invokes the skill and is not a path or part of the request. Begin following the skill's instructions now.\n<skill filePath=\"/private/tmp/claude-501/-Users-yetone-workspace-projects-magpie/4c056ab3-f2e6-4918-b774-da5c713ce1e3/scratchpad/dh/.factory/skills/greet-user/SKILL.md\">\n<name>greet-user</name>\n<description>Greets the user warmly. Use when the user asks to be greeted. (personal)</description>\nReply with exactly: \"Hello from greet-user!\"\n</skill>\n</system-notification>"}],"interactionMode":"auto"},"seq":1}+{"type":"message","id":"baf1879a-16ab-40e6-8c52-f84d043fdf65","parentId":"fe3751bf-9a6f-4e08-8c01-3cce10f741f7","timestamp":"2026-10-30T03:02:17.660Z","message":{"role":"assistant","content":[{"type":"thinking","signature":"","signatureProvider":"anthropic","durationMs":0,"thinking":"The user has invoked the /greet-user skill. According to the skill instructions, I need to reply with exactly: \"Hello from greet-user!\"\n\nThis is straightforward - I just need to follow the skill's instruction exactly.\n"},{"type":"text","text":"\n\nHello from greet-user!"}],"modelId":"custom:mh","reasoningEffort":"high"},"seq":2}+{"type":"agent_turn_outcome","turnId":"fe3751bf-9a6f-4e08-8c01-3cce10f741f7","reason":"completed","resultKind":"text"}diff --git a/internal/sessions/testdata/droid-skills/sessions/-w/cb1d8bed-aa2c-4ba2-a23f-681dc5da403f.settings.json b/internal/sessions/testdata/droid-skills/sessions/-w/cb1d8bed-aa2c-4ba2-a23f-681dc5da403f.settings.jsonnew file mode 100644index 000000000..b68160458--- /dev/null+++ b/internal/sessions/testdata/droid-skills/sessions/-w/cb1d8bed-aa2c-4ba2-a23f-681dc5da403f.settings.json@@ -0,0 +1,41 @@+{+ "assistantActiveTimeMs": 2240,+ "model": "custom:mh",+ "reasoningEffort": "high",+ "interactionMode": "auto",+ "autonomyLevel": "low",+ "autonomyMode": "auto-low",+ "compactionThresholdCheckEnabled": true,+ "allowSubagentsInScripts": false,+ "tags": [+ {+ "name": "exec"+ }+ ],+ "toolExecutionMode": "direct_only",+ "toolExecutionModeModelId": "custom:mh",+ "tokenUsage": {+ "inputTokens": 15329,+ "outputTokens": 66,+ "cacheCreationTokens": 0,+ "cacheReadTokens": 0,+ "thinkingTokens": 60,+ "factoryCredits": 0+ },+ "childInclusiveTokenUsageBySessionId": {},+ "inclusiveTokenUsage": {+ "inputTokens": 15329,+ "outputTokens": 66,+ "cacheCreationTokens": 0,+ "cacheReadTokens": 0,+ "thinkingTokens": 60,+ "factoryCredits": 0+ },+ "providerLock": "anthropic",+ "providerLockTimestamp": "2026-10-30T03:02:15.421Z",+ "lastCallTokenUsage": {+ "inputTokens": 15329,+ "outputTokens": 66,+ "cacheReadTokens": 0+ }+}\ No newline at end of filediff --git a/internal/sessions/testdata/droid-skills/skills/greet-user/SKILL.md b/internal/sessions/testdata/droid-skills/skills/greet-user/SKILL.mdnew file mode 100644index 000000000..f9e03be74--- /dev/null+++ b/internal/sessions/testdata/droid-skills/skills/greet-user/SKILL.md@@ -0,0 +1,5 @@+---+name: greet-user+description: Greets the user warmly. Use when the user asks to be greeted.+---+Reply with exactly: "Hello from greet-user!"diff --git a/internal/sessions/testdata/droid-skills/skills/wave-hand/SKILL.md b/internal/sessions/testdata/droid-skills/skills/wave-hand/SKILL.mdnew file mode 100644index 000000000..b526d61a4--- /dev/null+++ b/internal/sessions/testdata/droid-skills/skills/wave-hand/SKILL.md@@ -0,0 +1,5 @@+---+name: wave-hand+description: Waves a hand at the user. Use when the user asks for a wave.+---+Reply with exactly: "*waves*"