Add focus mode

From glowingkitty/OpenMates · View interactive version

Add focus mode is an AI agent skill from the GitHub repository glowingkitty/OpenMates. Create or update OpenMates user-facing focus modes using the existing SKILL.md, app.yml, i18n, docs, and test patterns

How to use this skill

Skill file

Purpose

Use this skill when the user wants to create or update an OpenMates focus mode.

OpenMates focus modes are user-facing chat modes that temporarily change how a

mate thinks and responds for a specific goal. They are not agent modes,

editor modes, OS notification modes, or backend app skills.

Arguments

Parse $ARGUMENTS as optional hints:

If either value is missing, infer it during discovery or ask during the

clarifying rounds. Do not invent a final app or ID without user confirmation.

Workflow

Follow this structure closely. The user expects a deliberate plan-before-build

flow with two clarification blocks and a draft review gate.

Every clarifying question must include Recommendation: with the evidence-based

preferred answer and rationale plus Examples: with task-specific options or

outcomes. If uncertain, recommend the safest reversible default and state the

uncertainty.

Step 1: Check Existing Focus Modes

First inspect how focus modes already exist and how the target app is

structured.

Read or search these paths as relevant:

Identify whether the request is:

Step 2: Ask 3 Clarifying Rounds

Ask exactly one clear question per round and wait for the user's answer before

continuing. Stop early only if the user explicitly says to skip clarification.

Use these topics unless the repo context reveals more urgent blockers:

Step 3: Search Internal Context

Based on the answers, search internal sources for relevant connected

information and ideas.

Check:

Use GitHub Issues by default for tracker searches. Do not create or update an

issue unless the user asks.

Step 4: Search External Context

Search externally for ideas and best practices relevant to the requested focus

mode.

Use:

Claude skills, or domain-specific assistant workflows

legal, safety, education, jobs, security, privacy, or other high-risk topics

Keep this research practical. Extract patterns that improve the OpenMates focus

mode contract; do not copy prompts wholesale.

Step 5: Ask 3 More Clarifying Rounds

Ask exactly one clear question per round and wait for the user's answer before

continuing.

These questions must be informed by the internal and external research. Use them

to resolve:

Step 6: Suggest a Draft

Present a concise draft and ask for feedback before editing product files.

The draft must include:

For updates, show a focused diff-style summary of what will change.

Step 7: Ask for Feedback

Wait for the user's feedback. Do not implement before this gate unless the user

explicitly says to proceed without draft approval.

Step 8: Finalize the Draft

Incorporate feedback and show the final version briefly. Confirm any remaining

tradeoffs, such as activation breadth, default-enabled behavior, or safety wording.

Step 8b: Define Phase Gates

Before implementation, record the phase gate in the draft, inline contract, or

full spec:

  1. Implement and test focus-mode behavior through real OpenMates CLI chats

against the dev server first. Mocked OpenMates API calls, mocked SDK clients,

stubbed servers, direct function calls, and fixture replay do not satisfy this

gate.

  1. Implement and test npm SDK and pip SDK parity locally against the dev server

when focus-mode activation or memory/settings behavior is exposed

programmatically. After local CLI and SDK evidence is green, reproduce or wire

the same coverage into GitHub Actions for CI/daily tests.

  1. Implement web settings, examples, or Playwright coverage only after CLI and

required SDK evidence are green.

  1. Run deployed Playwright visual smoke for larger web/UI surfaces in both laptop

and mobile viewports, fixing and redeploying any objective rendering, error,

loading, or responsiveness issue, then ask the user to confirm the deployed dev

web behavior works and looks correct before starting Apple parity. Use

Firecrawl only as a recorded fallback when Playwright is impractical or

blocked. *.spec.ts evidence alone is not enough.

  1. Start Apple parity only after CLI, SDK, web, and user-confirmation evidence are

complete, or after an explicit waiver/blocker is recorded. This applies to

Apple UI parity; Apple client logic comes from the Rust core and is not

sequenced behind web.

Step 9: Implement the Focus Mode

Use the current OpenMates implementation reality, not only the future target

architecture.

Primary authoring target:

Current compatibility targets that may also need updates:

Rules:

Step 10: Validate

Run the smallest checks that prove the change.

Usually relevant:

For any user-facing focus-mode behavior change, run a real OpenMates CLI chat

quality check after the metadata is built and, when testing dev behavior, after

the change is deployed to dev. Use the test-account helper or the compiled CLI,

for example:

Run multiple example requests that match the activation hint and inspect the

actual assistant output. Record whether the focus mode activated, which skills

were used, whether the answer followed the expected structure, and whether the

quality met the draft's success criteria. If the CLI cannot be run, document the

blocking reason instead of treating parser/build checks as behavior evidence.

For user-facing focus-mode behavior, propose the relevant E2E test path and use

the repo test runner after deploy when running Playwright:

Do not run Playwright locally.

Step 11: Add or Verify an Example Chat

Every enabled focus mode must have at least one permanent

example chat linked from its focus-mode details page. This applies to both new

focus modes and prompt/routing improvements to existing focus modes.

Before finishing:

existing example with metadata.app_focus_mode_examples containing

"{appId}.{focusId}".

and scaffold it with scripts/create-example-chat-from-share.mjs.

activation, use the CLI focus mention while creating the chat, but remove the

internal @focus:... wire prefix from public example-chat user text after

scaffolding.

metadata.active_focus_id: "{appId}-{focusId}" on the example chat so the

focus-mode page can surface it and the demo chat opens with the active focus

state visible.

run scripts/audit_example_chats.py before deploying.

not silently finish a focus-mode improvement without an example-chat plan.

Draft Template

Use this structure for Step 6 and Step 8.

## Focus Mode Draft

Name:
App:
Focus ID:
Directory:
Default enabled:

Description:

Activation hint:

Process:
- ...

How to use:
- ...
- ...
- ...

System prompt:
...

Allowed skills/apps:

Non-goals:

Safety and privacy:

Open questions:

Implementation Checklist

Before finishing, verify:

output-quality contract for behavior changes

metadata.app_focus_mode_examples for the focus mode

When to Escalate to a Full Spec

Use create-plan before implementation if the focus mode changes runtime behavior,

adds new persistence, introduces new API routes, changes activation/deactivation

semantics, touches encryption/privacy-sensitive data flows, or requires new app

skills/providers. Pure prompt/content additions can usually follow this skill

without a full spec.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.