Skip to content
Back to skills

Metis Development

ASecurity

Develop, debug, or refactor the Metis AI application, provider harness, MCP gateway, installers, and shared UI. Use for changes to the Metis repository; not for unrelated user projects or routine Metis tool use.

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 9, 2026
ai-agentsjavascripttypescriptrustgojavashellreactnextjsnodespring

Works with

  • cursor
  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add f1shyondrugs/metis-ai --skill metis-development --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Metis Development?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Metis Development
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/f1shyondrugs-metis-development/badge)](https://www.skillsdirectory.com/skills/f1shyondrugs-metis-development)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: metis-development
description: "Develop, debug, or refactor the Metis AI application, provider harness, MCP gateway, installers, and shared UI. Use for changes to the Metis repository; not for unrelated user projects or routine Metis tool use."
metadata:
  category: Development
  tags: "Metis, Refactoring, Runtime, MCP, Testing"
---

# Metis Development

Metis is both a public application and the runtime executing this work. Changes must work on fresh installations and preserve the active harness.

## Find the owning layer

Establish the repository root and read its `AGENTS.md`, then the relevant entry in `docs/README.md`. Inspect `git status` before editing and preserve existing unrelated changes. Use [the code map](references/code-map.md) to locate the current owner of behavior; confirm callers with scoped searches.

Provider capabilities and model metadata come from the typed provider registry and live discovery. Missing metadata stays unknown. Provider adapters use the canonical Metis MCP tool contract; do not add native file, shell, browser, task, or agent fallbacks.

## No hardcoded deployment or site domains

Do not hardcode real domains, origins, CDN hosts, or instance URLs in Metis
product code, including provider-specific browser exceptions and fallback
allowlists. Resolve deployment URLs from existing configuration and service
endpoints from trusted connection settings or validated provider discovery.
For browser access exceptions, use an explicit operator-controlled policy
bound to the configured site; do not infer trust from page content or a URL
supplied by the page. If no approved configuration exists, leave the feature
unavailable rather than adding a domain fallback. Verify both a configured
non-default origin and the unconfigured case with synthetic test domains.

## Modular source ownership

Use `docs/MODULE-ARCHITECTURE.md` when it exists in the checkout. Older releases
may still use `components/` and `lib/`; confirm the branch before following a
path. Do not copy a newer directory tree into a live or older checkout just to
make paths match.

- Keep routes and process entry points stable. Put feature UI and client state
  in `features/<domain>/`, server-only operations in `server/<domain>/`, and
  reusable components or wire types in `shared/`. Shared code must not import
  feature or server implementations at runtime. Prefer neutral contract types
  over coupling a consumer to the owning UI or storage module.
- Keep the shell responsible for cross-feature coordination. Move state with
  the owner of the operation and expose explicit callbacks, not a second
  AppShell, a global store, or a catch-all utility file. Reuse an editor,
  attachment preview, or model picker without merging its callers' persistence
  or authorization rules. Keep feature CSS with the feature and preserve the
  global Tailwind import/cascade order.
- Use `packages/mcp-gateway/index.mjs` as the public module and
  `packages/mcp-gateway/cli.mjs` as the modular executable. Keep authorization
  and approval before any dispatch; preserve discovery schema and order, the
  credential/session boundary and required ESM/legacy launcher paths.
- For a path migration, also check runtime-resolved worker URLs, CLI scripts,
  package/updater validation, deploy templates, CSS source globs and fixtures
  with embedded imports. Run `pnpm test:architecture` on the modular checkout,
  the same behavioral tests before and after, and one isolated production
  build. Compare failures against the same baseline rather than declaring a
  dirty baseline green. Verify actual route paths, tool schemas and entry point
  execution when those boundaries move. Validate expected destinations in the
  staged tree and build a clean Git export: a broad ignore rule can hide new
  source files from a patch even when an in-place build passes. Narrow any
  exception to the source directory without unignoring runtime data.

## Reuse behavior, preserve contracts

Before adding a function, search for its behavior and callers, including implementations with another name. For a scoped inventory of exact function-body copies, run `node skills/manual/metis-development/scripts/find-duplicates.cjs [directory ...]` from the repository. The scanner covers JavaScript and TypeScript, including CommonJS and ESM; for Desktop pass `desktop/src/main desktop/src/device` explicitly. Review each candidate and its callers because equal bodies can depend on different surrounding policies. Prefer an existing canonical helper. When copies have the same semantics, move the smallest coherent behavior into a shared module and migrate the callers together. Keep differences explicit through a small typed parameter or separate domain functions; do not erase owner boundaries, defaults, error messages, or parsing limits to make code look alike.

Keep browser helpers separate from server code, and preserve the ESM boundary for standalone MCP modules. Avoid a catch-all utility file and abstractions with one-off switches. A shared API must describe the behavior it owns.

Test the observable contract before and after the refactor: authentication and account scope, malformed payloads, text ordering, cleanup on unmount, persisted settings, and fresh-install defaults as relevant. Reuse existing test suites; add focused boundary tests for behavior that could drift. Source-string checks alone cannot establish correctness.

For individually published artifacts in an existing chat share, bind approval to the authenticated owner, the exact share and the owner-read artifact revision. Recheck eligibility and revision after visitor authorization; hide edits until an explicit new approval. Keep the publication manifest and IDs out of the visitor payload, and verify the public artifact does not persist in a cloned chat.

When a regression test extracts an AppShell callback into a VM, surface any caught exception before changing the product. Supply the callback’s real closure dependencies as observable test doubles; assert a meaningful effect after the last observer so a caught late failure cannot make the test falsely pass. When testing whether a PATCH preserves chat activity, compare against the first persisted GET, not the creation response.

When bundling an isolated Metis UI fixture from a staged web snapshot, use that snapshot’s `tsconfig.json` and `node_modules` for both the fixture (including React and its renderer) and the imported app components. Mixing dependencies from the canonical checkout with snapshot aliases can bundle two React instances and leave the fixture blank with a null hook dispatcher. Verify the actual rendered controls in the in-app browser with synthetic account/device state.

For Electron multi-window ownership, passive click feedback and native-coordinate verification, read [the desktop guidance](references/electron-windows-and-coordinates.md).

## Compact controls and reference appearance

For a compact inline section that reveals details in Metis (such as tool groups and “View HTML”), reuse `ActivityDisclosureTrigger` from `shared/ui/activity-disclosure-trigger.tsx`. Keep the left chevron and row styling shared, wire `aria-expanded`/`aria-controls` to the panel, and verify click and keyboard operation. Do not use a browser-default `<details>/<summary>` triangle or add a second custom disclosure style. This is for expanding content in place, not for selection controls or action menus, which keep their existing primitives.

The shared Button primitive defaults to `shrink-0`. Bound and explicitly shrink unpredictable model/account labels before fixed Context/Usage controls; test the actual footer parent, not only the standalone picker, and retain an operable full-value disclosure. Reference rows reuse `ReferenceResultIcon`/`ReferenceResultMetadata`, `NoteIcon` and `NotebookProjectIcon` so item glyphs and authorized project context keep their separate colors/logos.

For automation appearance, omission preserves the icon and null removes it. A one-field icon change must remain metadata-only in both editor requests and storage: do not rebuild schedules, resume completed/error tasks, or clear claims/errors. Test the outgoing request as well as the API, and verify additive-schema compatibility with old writers.

## Calendar date precision

For calendar/time-zone work, read `docs/CALENDAR.md` and reuse `shared/contracts/calendar/time-zone.ts`. Keep date-only values as date strings and use FullCalendar's offset-aware `dateStr` for clicks. New drafts shown in minute-precision inputs must be rounded to that precision: fractional milliseconds cannot round-trip through second-precision ICS and can misleadingly trigger the existing time-zone-definition mismatch error. Do not remove that export guard. When an existing local input is unchanged, retain its original ISO instant/offset to disambiguate DST fall-back times; reject nonexistent spring-forward input instead of silently shifting it. Test both cases and a real canonical API round trip.

All-day `DTEND` is exclusive: normalize a same-day timed draft to a following-date end, constrain the end picker, and keep a submit/API guard. Test start changes, leap days and valid multi-day ranges. For time-zone export, a newer bundled database can differ from runtime ICU; accept a generated definition only when both endpoints round-trip to the requested instants. Preserve matching IANA alias TZIDs and imported definitions; do not fix a mismatch by dropping its guard or silently rewriting recurrence exceptions.

## Settings navigation

Settings categories are compact overviews, not mixed overviews and full forms. Give each independent feature a peer `SettingsTile` opening a `SettingsFeaturePane`; for example, Security → Passkeys and Security → Credential vault use the same detail-navigation pattern. Reuse the existing primitives instead of inventing another tab style. Keep built-in labels and accessibility text English.

Update `features/settings/navigation/settings-navigation.ts` together with `features/settings/navigation/settings-pane.tsx` (pane type and section mapping) and the overview tile and detail branch in `features/settings/settings-panel.tsx`. Preserve search/deep-link destinations, mobile category → detail → back navigation, focus return to the originating tile, and role-based visibility. Mount data-loading managers only inside their detail pane, so overview visits do not fetch or expose their data. Cover overview composition, search and desktop/mobile navigation in the existing settings regression suites.

## Skills and settings

`skills-lock.json` registers complete skill packages; keep scripts, references, and assets beside `SKILL.md`. Default activation is owned by `server/skills/skills.ts`. Both Cursor and alternative providers use `buildSkillContext` for per-turn skill injection. Explicit user disable and Always-on overrides must remain effective; do not rewrite users' saved preferences to apply a new default.

Register a new package with the bundled Skill Creator's `scripts/register_skill.py`, validate it with `scripts/quick_validate.py`, and include its lockfile entry. Keep development guidance match-based unless the user requests Always on. Test fresh state without borrowing the production database or credentials.

## Verify and ship within the requested scope

Own the rollout and frontend verification after every Metis product change. Use the target host's current operator-approved release procedure, not commands from historical rollout records. For the production VPS with the direct A/B updater, follow the current Metis project deployment instructions: verify the exact Git ref, run the documented updater from the independent VPS root console, and confirm the expected commit in `METIS_AB_LIVE`. Do not submit to the retired release broker on this host. Do not mount over files, change guards, or use another runtime to bypass approvals. Scope the release to the changed surfaces. If no runtime artifact changed, deployment was declined, or a required approval or safe access path is missing, finish isolated verification and report what is staged versus actually live.

After each deployment, open the actual target frontend in the Metis in-app browser and personally exercise the changed flow end to end with a dedicated test account, not the owner's account. Use the credential vault or protected login input for that exact origin. Use the least-privileged test role that reaches the feature, only disposable test data, and non-destructive checks in production. If authenticated production verification is blocked by access or would change global settings or a real account, perform the complete flow in an isolated browser preview with a synthetic account and report which live steps were not verified. Unit tests, HTTP health, and a public sign-in screen do not replace an authenticated browser check. Report the tested flow, the actual live build and `verify_work` result; capture representative evidence without account data when useful.

When ordinary browser actions repeatedly take a fixed multiple of a timeout, test identical synthetic pages with and without the optional metadata element. Playwright locator reads such as `getAttribute` wait for a match; an outer timeout can hide several duplicated waits per response. Prefer a non-waiting DOM read for optional metadata and avoid duplicate lookups within the same audience. Preserve the user/agent/protected redaction boundary; never reuse owner-only metadata in agent results.

If a protected Metis self-login accepts credentials but the context disappears during the initial Chat load, try a fresh protected login on the same origin with `/?c=calendar` and resize the **protected** viewport to 850 × 880 before submitting. Once the authenticated Calendar appears, use normal in-app navigation to reach the changed surface. This combination recovered live smoke tests; neither the link nor the resize alone was reliable in the observed incident. Treat it as a fallback, not a root-cause diagnosis or permission to weaken browser protections. Do not count a server-side session, startup API responses or the workaround itself as a completed UI check.

After a protected login, if `browser_form_state` lists a visible control but the click reports no usable match, capture the protected screenshot before retrying selectors. A full-screen Welcome overlay can cover the workspace while the form still lists buttons behind it. For the dedicated test account, complete Welcome with Continue and Finish, then inspect fresh selectors and exercise the requested flow; do not change provider, pairing, or account privileges just to dismiss onboarding. If a protected session disappears after a form submission, the write may already have succeeded. In a fresh protected login, inspect the durable result before retrying; provider connection saves and model refreshes were observed to persist despite the session loss.

When an in-app browser acceptance depends on a transient Sonner toast, wait on the specific toast action button (for example, `[data-sonner-toast][data-type="info"] button[data-action]`) in the same batch as the trigger. Hover the verified button to pause expiration before sharing evidence. A late snapshot or a text-only timeout does not prove the toast was never shown. Check durable side effects separately, and use instrumented fixtures for diagnosis only; accept the expected action on the unmodified artifact.

Run focused tests while iterating, then the required type check and production build after changes settle. Use isolated data roots, ports, and named test services for runtime checks. Do not stop live Metis services or the remote client as test cleanup.

When verifying continuity across a systemd `daemon-reload`, compare `MainPID` and `ActiveEnterTimestampMonotonic` separately from the normalized `ExecStart` command and `WorkingDirectory`. The per-command event fields such as `start_time` and `pid` inside `ExecStart` can reset even when the process did not restart; keep the command path and arguments in the comparison.

For isolated acceptance of Metis PDF exports, a 503 may mean the renderer cannot find Chromium under the test account’s temporary HOME. Confirm the compatible installed binary cache and mount it read-only with `PLAYWRIGHT_BROWSERS_PATH` for the isolated renderer only. Do not reuse browser profiles. Capture the actual download through the in-app browser.

For prebuilt updater packages, test the extracted artifact with its bundled runtime, pruned dependencies and isolated HOME/data—not only the source checkout. A TypeScript Next configuration can trigger compiler installation after pruning; emit JavaScript in CI or retain an intentional runtime dependency, and verify startup leaves package/lock files unchanged. Packages nested below a bootstrap Git checkout can inherit the wrong commit identity; test a deliberately different parent checkout. On Windows, detached process groups do not escape `taskkill /T`: use an independent executor at the same verified identity/effective authority, and test that the new host survives updater exit and task cleanup. Managed launchers should name physical release paths in argv so retention can protect running versions even when cwd/exe metadata is hidden.

On systemd Linux deployments, `packages/mcp-gateway/src/dispatch/resource-scope.mjs` automatically puts shared-spawn tool commands in per-invocation bounded scopes, preserving UID/groups, sanitized environment, cwd, stdin and the existing mount namespace. Manager failure must not fall back to an unbounded command. Old gateway processes retain the pre-update behavior until drained: their children can share the gateway cgroup, where a compiler or FFmpeg OOM plus `OOMPolicy=stop` disconnects every session. A Node heap flag or detached shell does not isolate that workload. Confirm the actual process version and cgroup, not only source files.

Run memory-heavy builds, type checks and media jobs in an authorized, separately bounded transient systemd unit, with explicit working directory, resource limits and isolated test data. Preserve the caller's permitted identity and environment boundaries; do not copy production/provider secrets into test units or weaken protections. Verify `/proc/self/cgroup` inside the job differs from the gateway and that gateway PID/restart count remain unchanged. Keep normal authenticated network operations in the approved tool environment. If separate execution is unavailable, report the limit rather than stress-testing the live gateway.

For an offline hosting benchmark of a built Metis release, stage only allowlisted code and runtime inputs with fresh synthetic data. A service's `PrivateTmp` may be invisible to the Docker daemon; use a dedicated private directory in a daemon-visible filesystem. Follow the active worker's `execve` child entrypoint to its actual code and dependency root: redirecting its absolute target back to the wrapper can loop without producing job events. Record cgroup `pids.events` as well as `memory.events` (a tight task/thread cap can surface as `EAGAIN` without an OOM); if `memory.peak` is unavailable, report the sampling interval and the observed maximum, not a kernel peak. Do not present a same-CPU cgroup comparison as a cloud-VM or provider-latency benchmark.

For per-component RAM attribution in a Linux benchmark, sample `/proc/<pid>/smaps_rollup` PSS only for PIDs in the verified fixture cgroup. Group children by actual entrypoint and ancestry (separate Chromium from web, and the load generator from product processes). Compare medians by phase and take every component at the same sampled cgroup peak; independent maxima are not additive. Preserve unreadable-PID counts and record the cgroup total separately from process PSS. Do not weaken process isolation to obtain a reading.

When diagnosing unexplained PSS inside a Node web process, use `v8.getHeapStatistics()` per isolate (main plus worker and loader isolates) and `/proc/self/smaps_rollup` once per process; do not sum per-isolate RSS or add `arrayBuffers` to `external`. On an offline synthetic build only, a preload with an in-process Inspector session can sample allocations and run a deliberate GC after recording the untouched idle baseline. Compare against a fresh run without allocation sampling and recheck the same authenticated fixture requests afterward. Allocation call sites do not establish retained ownership, and an isolated heap-flag win needs a workload/latency A/B before any production change.

For a permitted synthetic loopback fixture that must survive the tool invocation, verify the listener before driving the browser. A detached child can be reaped with its command scope, and a launcher’s private `/tmp` may not be visible to a separate unit. Use an explicitly named unprivileged test unit with bounded lifetime and only non-secret fixture code visible to it, verify the expected loopback port/PID, and stop only that fixture after the test. Do not use this to change production units or bypass network or release policy.

Staged web snapshots can retain a different canonical `AI_CHAT_INSTALL_DIR` for jobs and data. Pin server-side worker entrypoints to the actual web source revision (`AI_CHAT_SERVER_SOURCE_DIR` in the slot wrapper), and test with a deliberately different legacy install root; otherwise the new UI can silently call an older search worker. Merge the actual live wrapper rather than replacing it with Git's generic version, preserving explicit data/MCP/install-root guards.

For an authorized deployment, read `docs/DEPLOY.md` and the current deployment configuration. Build the inactive production slot with `scripts/build-production-slot.sh`; never overwrite the active slot. Switch only after the build succeeds. Restart only the service required by the approved deployment, preserving the worker/MCP runtime when instructed. Verify the artifact's BUILD_ID, active service, and actual HTTP response through `verify_work` before reporting deployment success.

On an intentional split Next.js deployment, verify the HTML and referenced script/style bytes for both the chat root and a non-root entry point (such as Desktop Assistant). A 200 HTML shell does not prove hydration. If both builds must remain reachable through one static URL prefix, a static-only Nginx 404 fallback can serve chunks absent from the first slot without rerouting APIs or upgraded connections. Also verify a real asset miss remains 404 and compare process identities and active job leases before and after a graceful reload.

Commit only the owned changes. Preserve the configured author and provide the direct GitHub commit link when pushing. Report what changed, what was verified, and any material limit; a refactor does not prove that unrelated instability has been resolved.

Files in this skill

  • SKILL.md4.1 KB
  • references/code-map.md2.7 KB
  • scripts/find-duplicates.cjs2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.