# Authoring an App Skill

You're a coding agent working in the repository of an application that is tested by our cloud QA browser agent. Your job: produce a **skill** — a per-property knowledge base — so that when the QA agent runs workflows against this app, it has the institutional knowledge it can't infer from the DOM alone.

**Feedback.** Tell Cofactor the moment a step in this guide is wrong, unclear or missing; a command fails in a way the guide did not predict; you took a detour or had to guess; or a tool you needed does not exist. Send it when it happens, not only at the end: one sentence on what happened and what would have helped. Run `cofactor feedback "<what happened; what would have helped>" --topic instructions --command "cofactor application skill guide <section>"`, or call the `cofactor_feedback_submit` MCP tool with the same text, topic and command. Never include secrets, customer data, real names or URLs; use neutral examples (Acme, example.com).

You are the primary author of this skill. You have everything you need: the source, your existing memory/notes about the app, and your judgment about what actually matters for end-to-end testing. This guide tells you *what to produce*, not how to investigate — you already know how to do that.

## The critical constraint

**The skill is consumed by a runtime browser agent that has only the DOM, `page.*` actions, and `page.request`. It has no source code, no repo, no file system, no access to anything you can read.**

Every item you write must be useful in that world. Your repo is the *source* you read; the skill content is the *translation* into runtime-actionable knowledge.

✅ "Org switching is reflected in the URL: paths under `/o/<slug>/…` are tenant-scoped, and navigating directly to a path with a different `<slug>` is the canonical way to switch."
❌ "See the org middleware in the auth package for how tenant context is set."

✅ "When a feature is gated off, the most common signal is the action button being absent from the DOM (not disabled). Less commonly, the route renders a 'requires upgrade' empty state, or a mutation returns a typed error like `FEATURE_DISABLED`."
❌ "The feature-flag service exposes a `useFlag()` hook checked by the `<Gate>` component."

**The translation check, for every item:** *if all I had was a browser, would this sentence help me?* If it names a file, internal class, hook, middleware, package, or private symbol — rewrite as observable behavior or drop it.

This applies to *examples too*. Don't write "the `/api/v2/widgets` endpoint" if it's just a plausible-sounding example you invented — the QA agent will look for that exact path and be confused if it doesn't exist. Either it's real and stable, or omit it.
