implementing-agent-modes
Guidelines to create/update a new mode for PostHog AI agent. Modes are a way to limit what tools, prompts, and prompt injections are applied and under what conditions. Achieve better results using your plan mode.
npx skills add majiayu000/claude-skill-registry --skill implementing-agent-modes --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Agent modes Use the steps below to plan or implement a new mode. A mode is a way to manage the context of the agent and inject tools, prompts, and mode-related behavior relevant to a product, use case, JTBD, etc. The agent has the `switch_mode` tool that allows it to switch itself to another mode, which might change tools, prompt, and executables, preserving the current context. Some previously created tools are contextual, meaning they're injected on particular pages of the frontend. The modes change the approach and always have tools in the mode context. ## Determine mode name Explore the `ee/hogai/core/agent_modes/presets` directory and check if there are already modes that match the user's intent. If you want to create a new mode, you should scope it by a PostHog product (Product analytics), product area (SQL), or agent (Instrumentation agent). ## (optionally) Create a new mode in schema Add a new AgentMode to `frontend/src/queries/schema/schema-assistant-messages.ts` and regenerate the schema using: ```bash hogli build:schema ``` Alternatively, you may use this command: ```bash pnpm run schema:build ``` ## Create or update mode's scaffolding A mode should typically contain a
- Determine mode name
- (optionally) Create a new mode in schema
- Create or update mode's scaffolding
- Adding tools to the mode
- Review the default toolkit
- Write JTBD-like trajectory examples
- Implement frontend
- Example
- Add feature flag
- Implement and update tests
hogli build:schema pnpm run schema:build
What does the implementing-agent-modes skill do?
Guidelines to create/update a new mode for PostHog AI agent. Modes are a way to limit what tools, prompts, and prompt injections are applied and under what conditions. Achieve better results using your plan mode.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill implementing-agent-modes --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
