[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116814":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":9,"trendingCount":14,"starSnapshotCount":14,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},116814,"template-factory","mastra-ai\u002Ftemplate-factory","mastra-ai","An agent-powered software delivery environment built on Mastra.",null,"TypeScript",78,3,51,0,1,10,12,46.43,false,"main",true,[],"2026-11-18 05:41:02","2026-11-23 14:37:30","# Mastra Factory\n\nMastra Factory is an open source environment for building software with coding agents. Connect your repository to turn issues into plans, implementations, and reviewed pull requests.\n\nScaffold it with [`npm create factory`](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fcreate-factory). This project contains the Factory Server and its configuration. Keep it separate from the repository you want agents to change.\n\nRead the [documentation](https:\u002F\u002Ffactory.mastra.ai\u002F) or [watch the Mastra Factory overview](https:\u002F\u002Fyoutu.be\u002FiMA-Xkhj7fU).\n\n## Start the Factory Server\n\nThis template uses Mastra platform services for authentication and sandboxes, and PostgreSQL for storage. `npm create factory` provisions a platform project and a Postgres database and writes their credentials to `.env`. For a direct checkout, run `npm install`, copy `.env.example` to `.env`, and fill in the values from your Mastra platform project. To run without the platform, use `npm create factory -- --no-platform`, which scaffolds the self-hosted template instead.\n\n`npm create factory` also generates `FACTORY_CREDENTIAL_ENCRYPTION_KEY`, which encrypts stored model keys and integration secrets. If it's missing from `.env`, generate a key once for this project:\n\n```bash\nopenssl rand -base64 32\n```\n\nSave the output as `FACTORY_CREDENTIAL_ENCRYPTION_KEY` in `.env`. Preserve the key across restarts and deployments, and keep a protected backup. See [credential encryption](https:\u002F\u002Ffactory.mastra.ai\u002Freference\u002Fconfiguration#stored-credential-encryption) for details.\n\nFrom the Factory project directory, start the server:\n\n```bash\nnpm run dev\n```\n\nWith the default setup, open the local URL printed by the server and sign in through Mastra platform. One server serves both the Factory UI and API. After login you'll see an onboarding wizard, select the repository agents should change. Use **Manage GitHub connection** to grant the GitHub App access if the repository is missing. Optionally add Linear. Connect a model provider using an API key or a supported subscription, then choose the Factory model.\n\n## Run your first issue\n\n1. Open **Settings → Work Intake → GitHub issues**. Enable **Sync GitHub issues** and select your repository. Each teammate chooses their own issue sources.\n1. Create a small GitHub issue, such as adding contribution guidance to the repository's README.\n1. Find the issue in **Work → Intake**, select **Investigate**, and open its session to follow the agent's work.\n\nContinue with the [issue-to-pull-request walkthrough](https:\u002F\u002Ffactory.mastra.ai\u002F#create-your-first-pull-request) to review a plan and take the change through implementation and pull request review.\n\n## Configure your Factory\n\nChoose authentication, storage, and sandboxes independently. Model providers and issue sources are configured through the Factory UI. Server settings live in `.env`; restart the server after changing them.\n\n| Configuration                                              | What you can change                                                           |\n| ---------------------------------------------------------- | ----------------------------------------------------------------------------- |\n| [Models](https:\u002F\u002Ffactory.mastra.ai\u002Fconfigure\u002Fmodels)       | Provider access, personal or organization credentials, and the default model. |\n| [GitHub](https:\u002F\u002Ffactory.mastra.ai\u002Fconfigure\u002Fgithub)       | Repository access and personal issue intake.                                  |\n| [Linear](https:\u002F\u002Ffactory.mastra.ai\u002Fconfigure\u002Flinear)       | Workspace connection, project selection, and routing issues to a Factory.     |\n| [Jira](https:\u002F\u002Ffactory.mastra.ai\u002Fconfigure\u002Fjira)           | Site connections, project selection, and routing issues to a Factory.         |\n| [Slack](https:\u002F\u002Ffactory.mastra.ai\u002Fconfigure\u002Fslack)         | App setup, account linking, and starting sessions from Slack.                 |\n| [Auth](https:\u002F\u002Ffactory.mastra.ai\u002Fconfigure\u002Fauth)           | Mastra platform sign-in or another provider with Server and Studio support.   |\n| [Storage](https:\u002F\u002Ffactory.mastra.ai\u002Fconfigure\u002Fstorage)     | The database connection or Factory storage adapter.                           |\n| [Sandboxes](https:\u002F\u002Ffactory.mastra.ai\u002Fconfigure\u002Fsandboxes) | Mastra platform, local execution, or another Mastra sandbox provider.         |\n\nThe server requires `DATABASE_URL`, a PostgreSQL database with pgvector. Deployments to Mastra platform receive it from the project's attached database.\n\nSlack is bundled but disabled unless you set Slack credentials. For webhook mode, set `SLACK_APP_SIGNING_SECRET`, `SLACK_APP_BOT_TOKEN`, `SLACK_APP_CLIENT_ID`, and `SLACK_APP_CLIENT_SECRET`. For Socket Mode, use `SLACK_APP_TOKEN` instead of `SLACK_APP_SIGNING_SECRET`; the other three variables are still needed. A bot token alone cannot receive events or link Slack users, and an incomplete configuration fails at startup rather than silently disabling Slack. Set `MASTRACODE_PUBLIC_URL` to your HTTPS Factory origin for account-linking callbacks; for local development, set `MASTRACODE_CHANNELS_PUBLIC_URL` to an HTTPS tunnel origin instead. See [Slack configuration](https:\u002F\u002Ffactory.mastra.ai\u002Fconfigure\u002Fslack) for app setup and callback URLs.\n\nWith `MASTRA_PLATFORM_SECRET_KEY` (or `MASTRA_PLATFORM_ACCESS_TOKEN`) set, `npm run dev` runs agent commands in local sandboxes on your machine, and deployments use Mastra platform sandboxes, which also need `MASTRA_PROJECT_ID` and `MASTRA_ENVIRONMENT_ID`. To pick a sandbox yourself, pass `sandbox` to `MastraFactory` in `src\u002Fmastra\u002Findex.ts`, for example `new LocalFactorySandbox()` from `@mastra\u002Ffactory`.\n\n## Deploy\n\n### Mastra platform\n\nDeploy the Factory Server to your Mastra platform project:\n\n```bash\nnpm run deploy\n```\n\nThe CLI reports the deployed Factory URL. See [Deployment](https:\u002F\u002Ffactory.mastra.ai\u002Fdeployment) for environment configuration and deployment options.\n\n### Self-host\n\nRun Factory as a persistent Node.js service on a virtual machine or in a container. Configure persistent storage and set `MASTRACODE_PUBLIC_URL` to the public HTTPS origin. Supply your provider credentials through the deployment environment, then build and start the server:\n\n```bash\nnpm run build\nnpm run start\n```\n\nKeep the project's CLI dependencies installed for these commands. You can use Mastra platform services while hosting the Factory Server elsewhere. See [self-hosting](https:\u002F\u002Ffactory.mastra.ai\u002Fdeployment#self-host) for runtime requirements and setup steps.\n\n## Scripts\n\n| Script           | What it does                                         |\n| ---------------- | ---------------------------------------------------- |\n| `npm run dev`    | Start the local Factory Server with its UI and API.  |\n| `npm run check`  | Typecheck the Factory Server.                        |\n| `npm run build`  | Build the server and Factory UI in `.mastra\u002Foutput`. |\n| `npm run start`  | Run the production build.                            |\n| `npm run deploy` | Build and deploy to Mastra platform.                 |\n\n## Troubleshooting\n\n- **Runtime:** Use a Node.js version that matches `engines.node` in this project's `package.json`.\n- **Port changes:** Set `PORT` and update `MASTRACODE_PUBLIC_URL` to match. Update callback URLs for any auth or integration apps you manage.\n- **Missing issues:** Check repository access and your **Work Intake** selections. See [intake troubleshooting](https:\u002F\u002Ffactory.mastra.ai\u002Ftroubleshooting#intake-is-empty).\n\nSee [Troubleshooting](https:\u002F\u002Ffactory.mastra.ai\u002Ftroubleshooting) for sign-in, provider access, and sandbox errors, or [Environment variables](https:\u002F\u002Ffactory.mastra.ai\u002Freference\u002Fconfiguration) for server settings.\n\n## License\n\nApache-2.0\n",2,"2026-11-24 04:54:16","CREATED_QUERY"]