Agent skill

Mobx

by MatrixAges in MatrixAges/polywise

Guides state management implementation using MobX + tsyringe.

MITAuto-check passedFrontend & Design

Install Mobx

skills CLI
$ npx skills add MatrixAges/polywise --skill mobx -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install MatrixAges/polywise mobx --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/MatrixAges/polywise.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.opencode/skills/mobx .claude/skills/mobx && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mobx
GitHub stars
662
Token cost
~1.3k tokens
SKILL.md length
364 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Guides state management implementation using MobX + tsyringe.

  • Works in 5 steps: Architecture Overview → Model Implementation Patterns → Parent-Child Model Communication → …
  • Tasks that involve State management
  • SKILL.md covers 1. Architecture Overview, 2. Model Implementation Patterns, 3. Parent-Child Model… and 4. Lifecycle Management, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Mobx is an agent skill from MatrixAges/polywise. Guides state management implementation using MobX + tsyringe. Triggered when handling data models, state logic, or Store architecture.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design, covering State management. The repository describes itself as: The open source agentic content system to make your contents alive. Self-hosted on any platform. ◑. The licence is MIT.

When your agent uses it

  • Tasks that involve State management

Example prompts

  • “Use the mobx skill to guide state management implementation using MobX + tsyringe”
  • “/mobx”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Architecture Overview
  2. Model Implementation Patterns
  3. Parent-Child Model Communication
  4. Lifecycle Management
  5. Constraints and Best Practices

What it can do on your machine

Read from SKILL.md and the folder at commit f8d2320. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mobx loads about 1.3k tokens when it runs. Until then it costs about 35 tokens; SKILL.md has 364 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~35
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from MatrixAges/polywise at commit f8d2320, republished under its MIT licence (© MatrixAges). 364 words, ~1,270 tokens.

Download SKILL.mdSave it as .claude/skills/mobx/SKILL.md (or your agent's skills folder).
name
mobx
description
Guides state management implementation using MobX + tsyringe. Triggered when handling data models, state logic, or Store architecture.

MobX State Management Guide

This skill provides mandatory specifications for using MobX and tsyringe (for dependency injection DI) for state management in this project.

1. Architecture Overview

  • MobX: Core state management library (using makeAutoObservable).
  • tsyringe: Dependency injection container for models.
  • Modular Models: State is split into specialized models (e.g., GlobalModel, Settings).
  • Auto-binding: Actions are automatically bound to class instances.

2. Model Implementation Patterns

2.1 Basic Model Structure
typescript
import { makeAutoObservable } from 'mobx'
import { injectable } from 'tsyringe'

@injectable()
export default class FeatureModel {
	count = 0
	loading = false

	constructor() {
		// ✅ Use autoBind: true for convenient event handling
		makeAutoObservable(this, {}, { autoBind: true })
	}

	increment() {
		this.count++
	}

	async fetchData() {
		this.loading = true
		try {
			// API call logic
		} finally {
			this.loading = false
		}
	}
}
2.2 Singleton Model (Root Store)
typescript
import { singleton } from 'tsyringe'

import { Settings } from '@/models'

@singleton()
export default class GlobalModel {
	// ✅ Dependency injection via constructor
	constructor(public settings: Settings) {}

	init() {
		this.settings.init()
	}

	off() {
		this.settings.off()
	}
}
2.3 Handling Complex Models (DI Composition)

For complex state management (more than 20 reactive variables), models should be split into smaller, focused sub-models and composed using DI.

typescript
// ✅ Recommended: split complex models into multiple sub-models and inject
@injectable()
export default class ComplexFeatureModel {
	constructor(
		public data: DataSubModel,
		public ui: UISubModel,
		public sync: SyncSubModel,
		public util: Util
	) {
		// Note: exclude injected dependencies, don't make them observable
		makeAutoObservable(this, { data: false, ui: false, sync: false, util: false }, { autoBind: true })
	}
}

3. Parent-Child Model Communication

3.1 Accessing Singleton GlobalModel

In sub-models, you can declare a non-observable property and bind the singleton GlobalModel instance in the constructor using the getGlobal utility function.

typescript
import { injectable } from 'tsyringe'

import { getGlobal } from '@/utils'

import type { GlobalModel } from '@/models'

@injectable()
export default class SubModel {
	// ✅ Declare as non-reactive property
	global = null as unknown as GlobalModel

	constructor() {
		makeAutoObservable(this, { global: false }, { autoBind: true })

		// ✅ Bind instance via utility function
		getGlobal(this.global)
	}
}
3.2 Accessing Parent in Transient Models

In non-singleton models, container.resolve() creates new instances. To ensure sub-models access the correct parent instance, the parent must explicitly pass its reference.

Key Principles:

  1. Avoid Recursive Injection: Never call container.resolve(ParentModel) inside the constructor of a sub-model that the parent model depends on.
  2. Active Assignment: The parent model is responsible for establishing the association reference.

4. Lifecycle Management

All models should implement init() and off() methods for initialization setup and destruction cleanup.

typescript
@injectable()
export default class Index {
	constructor(public util: Util) {
		makeAutoObservable(this, { util: false }, { autoBind: true })
	}

	async init() {
		// ✅ Collect cleanup functions (disposers) into util.acts array
		this.util.acts = [
			/* ... */
		]
	}

	off() {
		// ✅ Execute cleanup logic
		this.util.off()
	}
}

5. Constraints and Best Practices

Show full SKILL.md (151 more words)Show less
5.1 Observable Rules
  • Reactive State: Define all reactive state as class properties.
  • Exclusions: Use the second parameter of makeAutoObservable to exclude injected services/util classes (set to false), preventing them from becoming reactive.
5.2 Dependency Injection (tsyringe)
  • @injectable(): For feature models that can be instantiated multiple times or locally injected.
  • @singleton(): For global stores that should only have one instance.
  • Constructor Injection: Always prefer constructor injection, and use the public keyword to automatically assign properties.
5.3 Code Style
  • No Comments: Don't write explanatory comments in model files.
  • snake_case: All reactive state variable names must use snake_case.
  • camelCase: All methods must use camelCase.
  • PascalCase: All class names must use PascalCase.
  • AutoBind: Always use { autoBind: true } in makeAutoObservable.
5.4 Common Errors
  • Forgetting the @injectable decorator will cause DI failure.
  • Forgetting to clean up reactions in off() will cause memory leaks.
  • Constructors should not be too heavy; time-consuming initialization logic must be placed in init().

© MatrixAges, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .opencode/skills/mobx of MatrixAges/polywise.

Open the folder on GitHubat commit f8d2320

Compare with similar skills

Mobx next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mobx compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mobx this skillMatrixAges/polywise662—~1.3kAutomated safety check: PassMIT
Svelte Core Best Practicesrilldata/rill2.9k4 repos~1.8kAutomated safety check: PassApache-2.0
Dify Component Writing Guidelanggenius/dify158k—~626Automated safety check: PassCustom licence
React State Managementinvolvex/youtube-music-cli45613 repos~3kAutomated safety check: PassMIT
GPUI Kit Desktop App GuideAprilNEA/OpenLogi23k—~5.5kAutomated safety check: PassApache-2.0
Pierre Theming Librarypierrecomputer/pierre6.2k—~661Automated safety check: PassApache-2.0

Similar skills

  • Rules for writing idiomatic Svelte 5 code: when to reach for runes like state, derived and effect, and how to handle props, attachments and bindings.

    2.9k GitHub starsUsed in 4 repos~1.8k tokens
    Frontend & DesignAuto-check passed
  • Use when implementing or refactoring React/TypeScript components and the task requires decisions about component ownership, feature boundaries, state, data…

    158k GitHub stars~626 tokensUpdated today
    Frontend & DesignAuto-check passed
  • React State Management

    involvex/youtube-music-cli

    Master modern React state management with Redux Toolkit, Zustand, Jotai, and React Query.

    456 GitHub starsUsed in 13 repos~3k tokens
    Frontend & DesignAuto-check passed
  • Guides building Rust desktop apps with the gpui-kit crate, covering component selection, state ownership, theming and overlays, plus normative GPUI coding rules.

    23k GitHub stars~5.5k tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • Pierre Theming Library

    pierrecomputer/pierre

    Explains how to use the @pierre/theming package to list, resolve, select, switch and persist themes, with controller, color and React references.

    6.2k GitHub stars~661 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Frontend Patterns

    kurealnum/dotfiles

    Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.

    290 GitHub starsUsed in 19 repos~3.7k tokens
    Frontend & DesignAuto-check passed

More from MatrixAges/polywise

All 11 skills in this repo
  • Chrome Cdp

    MatrixAges/polywise

    Interacts with local browser via Chrome DevTools Protocol (only triggered after user explicitly requests to inspect, debug, or interact with pages open in Chrome)

    662 GitHub stars~800 tokensUpdated 3 mo ago
    Auto-check passed
  • Skill Generator

    MatrixAges/polywise

    Called when users need to create new OpenCode skills. An agent skill from MatrixAges/polywise.

    662 GitHub stars~333 tokensUpdated 3 mo ago
    Auto-check passed
  • Agentmap Generator

    MatrixAges/polywise

    Guides the generation, reading, and updating of agentmap.md files.

    662 GitHub stars~489 tokensUpdated 3 mo ago
    Auto-check passed
  • CSS

    MatrixAges/polywise

    Guides styling implementation using TailwindCSS + CSS Modules.

    662 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Erpc Communication

    MatrixAges/polywise

    Guides using eRPC (electron-tRPC) for inter-process communication (IPC) between Electron main and renderer processes.

    662 GitHub stars~618 tokensUpdated 3 mo ago
    Auto-check passed
  • I18n

    MatrixAges/polywise

    Guides internationalization (i18n) implementation using i18next with TypeScript.

    662 GitHub stars~898 tokensUpdated 3 mo ago
    Auto-check passed

Questions about Mobx

What does Mobx do?

Guides state management implementation using MobX + tsyringe. Mobx is an agent skill from MatrixAges/polywise. Guides state management implementation using MobX + tsyringe.

When should I use Mobx?

Mobx fits situations like: tasks that involve State management.

How do I install Mobx in Claude Code?

Run `npx skills add MatrixAges/polywise --skill mobx -a claude-code`. Or copy the skill folder (.opencode/skills/mobx in MatrixAges/polywise) into .claude/skills/mobx in your project. Claude Code loads it when a task matches its description.

How do I install Mobx in Codex?

Run `npx skills add MatrixAges/polywise --skill mobx -a codex`. Or copy the skill folder (.opencode/skills/mobx in MatrixAges/polywise) into .agents/skills/mobx in your project. Codex loads it when a task matches its description.

Can I use Mobx in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add MatrixAges/polywise --skill mobx -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mobx, .gemini/skills/mobx, .github/skills/mobx and .opencode/skills/mobx in your project.

What does Mobx need to run?

SKILL.md names no scripts, command-line tools or credentials: Mobx is instructions for the agent only.

Does Mobx access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Mobx safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Mobx use?

Mobx is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mobx use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mobx?

Skills that share tags, products or a category with Mobx: Svelte Core Best Practices (rilldata/rill, 2.9k stars), Dify Component Writing Guide (langgenius/dify, 158k stars), React State Management (involvex/youtube-music-cli, 456 stars) and GPUI Kit Desktop App Guide (AprilNEA/OpenLogi, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mobx?

MatrixAges (a GitHub organization) maintains it in MatrixAges/polywise, which has 662 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on June 11, 2026.

Source: MatrixAges/polywise on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.