Repository navigation
docs: set up the engineering agent skills #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+155
−0
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,3 +36,6 @@ yarn-error.log* | |
| # Misc | ||
| .DS_Store | ||
| *.pem | ||
|
|
||
| # Agent skills scratch files | ||
| .scratch/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Glossary | ||
|
|
||
| Terms the React Native SDK (`packages/react-native`) uses, grouped by area. Use these words in issues, code and tests; the `/domain-modeling` skill adds new ones as they get resolved. | ||
|
|
||
| ## Setup and configuration | ||
|
|
||
| - **Workspace**: the Formbricks space the app's surveys, action classes and styling belong to, identified by `workspaceId` (`TWorkspace`, `src/lib/workspace/`). Replaces the older term _environment_: `environmentId` is a deprecated alias that still works, and stored configs that use it are migrated. | ||
| - **App URL**: the Formbricks instance the SDK talks to (`appUrl`), passed to `setup()` with the workspace ID. | ||
| - **Config**: the SDK's persisted state (`TConfig`, `RNConfig`): workspace ID, app URL, workspace state, user state and filtered surveys, stored in AsyncStorage. | ||
| - **Workspace state**: the workspace's surveys, action classes and settings as fetched from the server, cached with an expiry (30 minutes) and refetched when it lapses. | ||
|
|
||
| ## Users | ||
|
|
||
| - **User ID**: the app's identifier for the signed-in user, set with `setUserId()`. Without one the user is anonymous; `logout()` clears it. | ||
| - **Attributes**: key/value facts about the user (`setAttribute()`, `setAttributes()`, `setLanguage()`), sent to the server and used for targeting. | ||
| - **User state**: what the server knows about the user (`TUserState`): user ID, segments, displays, responses, last display time and language. | ||
| - **Segment**: a server-defined group of users; the SDK only receives the IDs of the segments a user belongs to and never evaluates segment filters itself. | ||
| - **Interaction refresh**: refetching a user's segments after a survey display, response or finish, gated per survey by `interactionRefresh` (`src/lib/user/interaction-refresh.ts`). | ||
|
|
||
| ## Surveys | ||
|
|
||
| - **Action**: a named event the app reports with `track(name)`; it can trigger a survey. | ||
| - **Action class**: the workspace's definition of an action (`TActionClass`), either `code` (tracked from the app) or `noCode`. | ||
| - **Trigger**: an action class a survey listens for (`survey.triggers`). | ||
| - **Display option**: how often a survey may show to one user (`displayOnce`, `displayMultiple`, `displaySome`, `respondMultiple`). | ||
| - **Filtered surveys**: the surveys this user is eligible for after display options, recontact days and segments are applied (`filterSurveys`). | ||
| - **Display**: one time a survey was shown to a user. | ||
| - **Response**: a user's answers to a survey. | ||
| - **Embedded Data**: app context attached to responses with `setEmbeddedData()` / `clearEmbeddedData()`. Held in memory, synchronous and never queued. A survey takes a snapshot of it when it opens, so later changes reach only surveys opened afterwards; values land only on fields the survey declares as ingested. | ||
| - **Survey web view**: the WebView that renders a survey with the Formbricks renderer (`src/components/survey-web-view.tsx`), mounted by the `<Formbricks />` component. | ||
| - **Appearance**: how surveys render, `light`, `dark` or `system` (`setAppearance()`); kept in memory only, never sent to the server. | ||
|
|
||
| ## Internals | ||
|
|
||
| - **Command queue**: runs the public async methods (`track`, `setUserId`, `setAttributes`, `logout`, …) one at a time, in order (`CommandQueue`). | ||
| - **Update queue**: debounces user ID and attribute updates into one request to the server (`UpdateQueue`). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Domain Docs | ||
|
|
||
| How the engineering skills should consume this repo's domain documentation when exploring the codebase. | ||
|
|
||
| ## Before exploring, read these | ||
|
|
||
| - **`GLOSSARY.md`** at the repo root. | ||
| - **`docs/adr/`**: read ADRs that touch the area you're about to work in. The folder does not exist until the first ADR is recorded. | ||
|
|
||
| This is a single-context repo: one glossary and one ADR folder for the whole repo, with terms grouped under headings by area. ADR files are numbered in sequence (`NNNN-short-title.md`); take the next free number. The `/domain-modeling` skill adds terms and ADRs as they get resolved. | ||
|
|
||
| This repo has no documentation site; the README points to the product docs at formbricks.com/docs. ADRs are engineering records, not product docs, and stay in this repo. | ||
|
|
||
| ## Use the glossary's vocabulary | ||
|
|
||
| When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `GLOSSARY.md`. Don't drift to synonyms the glossary explicitly avoids. | ||
|
|
||
| If the concept you need isn't in the glossary yet, that's a signal: either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`). | ||
|
|
||
| ## Flag ADR conflicts | ||
|
|
||
| If your output contradicts an existing ADR, surface it explicitly rather than silently overriding: | ||
|
|
||
| > _Contradicts ADR-0002 (Embedded Data stays in memory and never goes through the command queue), but worth reopening because…_ | ||
|
|
||
| (Illustrative only: there is no ADR-0002 yet.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Issue tracker: Linear | ||
|
|
||
| SDK work items live as Linear issues in the Engineering team (`ENG`), the same team as `formbricks/formbricks`; specs and PRDs live as Linear project documents (see below). Use the Linear MCP tools. | ||
|
|
||
| ## Conventions | ||
|
|
||
| - **Create**: `save_issue` with team `Engineering`, plus the project and milestone the work belongs to, a priority and labels. File straight into Todo. Triage is only for externally reported items and vulnerabilities, which follow the security process. | ||
| - **Read**: `get_issue` by identifier (`ENG-1234`); `list_comments` for the thread. | ||
| - **List**: `list_issues`, filtered by project, state, label or assignee. | ||
| - **Sub-issue**: `save_issue` with `parentId`. | ||
| - **Comment**: `save_comment`. | ||
| - **Labels**: `addLabels` / `removeLabels`, using existing labels only. Don't create labels without asking. | ||
| - **Close**: state `Done`; won't do → `Canceled`; duplicate → `duplicateOf`. | ||
| - **Blocking**: `blocks` / `blockedBy` relations. | ||
| - Never put secrets (keys, passwords, tokens) in Linear. A vulnerability ticket holds everything needed to fix it, exploit detail included. | ||
|
|
||
| ## Pull requests | ||
|
|
||
| This repo has no PR template: PRs link to issues through a ticket line in the PR description (`Fixes ENG-1234` / `Ref ENG-1234`). PRs are not a triage surface. | ||
|
|
||
| A PR built from a spec names the build's Linear issue on that line. The spec document and local tickets have no issue identifier, so the PR never references them. | ||
|
|
||
| ## When a skill says "publish to the issue tracker" | ||
|
|
||
| Create a Linear issue in `ENG`, in the project the work belongs to. Issues are for units of work. | ||
|
|
||
| A spec or PRD (for example from `/to-spec`) is not a unit of work: publish it as a Linear document in the project the work belongs to, numbered after the project's existing documents (`5. Engineering spec`). Tickets are cut from it when the build needs them (next section). | ||
|
|
||
| ## Before running `/to-tickets` on a spec | ||
|
|
||
| Tickets earn their place for one of two readers: | ||
|
|
||
| - **Agents**: the build outgrows one session. A session that holds the spec, the code it touches and the tests can build it in one go; past that, the build needs tickets, each sized for one fresh session. Rough guide: one session holds a PR of a few dozen hand-written files. | ||
| - **People**: engineers split the build between them and track it in the weekly sync. | ||
|
|
||
| Pick the path from those two questions: | ||
|
|
||
| | The build | Path | Where the tickets go | | ||
| | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | ||
| | Fits one session | `/implement` against the spec, in the session that wrote it | No tickets. One Linear issue for the build, which the PR closes | | ||
| | Outgrows one session, one engineer runs it | `/to-tickets`, then `/implement-spec` to build them in parallel, or `/implement` per ticket in a fresh session each | Local files under `.scratch/<feature-slug>/issues/`, plus one Linear issue for the build, which the PR closes | | ||
| | Engineers split it | `/to-tickets`, then each engineer runs `/implement` per ticket | Linear issues, as in Conventions, with `blockedBy` edges | | ||
|
|
||
| This table decides where `/to-tickets` publishes, ahead of the configured tracker: the middle row writes local files even though the tracker is Linear. | ||
|
|
||
| Local tickets are the agent's working files: they follow `/to-tickets`' local template, close by setting their `Status:` line to `done` (whenever a skill says to resolve a ticket the way the tracker closes work), and stay out of git (`.scratch/` is gitignored). | ||
|
|
||
| Because `.scratch/` is gitignored, a new worktree has no copy of it. When a skill hands a local ticket to a subagent in its own worktree (as `/implement-spec` does), pass the ticket's absolute path in the main checkout, or its full contents. | ||
|
|
||
| When `/to-tickets` asks about granularity, cut the coarsest vertical slices that still fit one fresh context window. | ||
|
|
||
| ## When a skill says "fetch the relevant ticket" | ||
|
|
||
| An `ENG-1234` identifier: `get_issue`. A local ticket (a `.scratch/<feature-slug>/issues/` path, or a ticket number or title from that folder): read the file. That includes `/implement` given a local ticket. | ||
|
|
||
| ## Wayfinding operations | ||
|
|
||
| - **Map**: one parent issue holding the Notes / Decisions-so-far / Fog body. | ||
| - **Child ticket**: a sub-issue of the map. Its type goes in a title prefix (`Research:`, `Prototype:`, `Grill:`, `Task:`), not a label. | ||
| - **Blocking**: Linear `blockedBy` relations. A ticket is unblocked when every blocker is Done or Canceled. | ||
| - **Frontier**: children in Todo with no open blocker and no assignee; first in map order wins. Children waiting on information stay in Backlog, so they are never picked. | ||
| - **Claim**: assign to yourself, as the session's first write. | ||
| - **Resolve**: comment the answer, set Done, and append a gist plus link to the map's Decisions-so-far. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Triage roles | ||
|
|
||
| Engineering uses no triage labels (`agent-ready` was retired on 23 Sep 2026). The five roles the skills speak of map onto Linear workflow states: | ||
|
|
||
| | Role | In Linear | Meaning | | ||
| | ----------------- | ------------------------------------------------- | ---------------------------------------------------------------------------- | | ||
| | `needs-triage` | **Triage** state | Externally reported items and vulnerabilities only; internal tickets skip it | | ||
| | `needs-info` | **Backlog**, plus a comment naming what's missing | Waiting on the reporter; never picked up as work | | ||
| | `ready-for-agent` | **Todo** | Fully specified; whoever picks it up decides who works it | | ||
| | `ready-for-human` | **Todo** | Same as above | | ||
| | `wontfix` | **Canceled** state | Will not be actioned | | ||
|
|
||
| When a skill says "apply the ready-for-agent label", move the issue to Todo instead. A spec is a Linear document and has no state, so `/to-spec` skips this step; the build's Linear issue goes to Todo. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.