@renseiai/create-agentfactory-app 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Rensei AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # @renseiai/create-agentfactory-app
2
+
3
+ Scaffold a new [AgentFactory](https://github.com/renseiai/agentfactory) project — a Next.js webhook server that processes Linear issues with coding agents.
4
+
5
+ > **Just want to deploy?** Skip scaffolding and use one-click deploy: [Vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Frenseiai%2Fagentfactory%2Ftree%2Fmain%2Ftemplates%2Fdashboard&project-name=agentfactory-dashboard&env=LINEAR_ACCESS_TOKEN,LINEAR_WEBHOOK_SECRET,REDIS_URL&envDescription=Environment%20variables%20needed%20for%20AgentFactory%20Dashboard&envLink=https%3A%2F%2Fgithub.com%2Frenseiai%2Fagentfactory%2Ftree%2Fmain%2Ftemplates%2Fdashboard%23environment-variables) | [Railway](https://railway.com/deploy/A7hIuF?referralCode=MwgIWL) (includes Redis). See the [dashboard template](https://github.com/renseiai/agentfactory/tree/main/templates/dashboard) for details.
6
+
7
+ ## Usage
8
+
9
+ ```bash
10
+ npx @renseiai/create-agentfactory-app my-agent
11
+ ```
12
+
13
+ Then follow the prompts:
14
+
15
+ ```
16
+ create-agentfactory-app
17
+
18
+ Project name (my-agent):
19
+ Linear team key (e.g., MY): ENG
20
+ Include dashboard UI? [Y/n]: Y
21
+ Include CLI tools (worker, orchestrator)? [Y/n]: Y
22
+ Include Redis for distributed workers? [Y/n]: n
23
+
24
+ Created 28 files
25
+
26
+ Next steps:
27
+
28
+ cd my-agent
29
+ cp .env.example .env.local
30
+ # Fill in LINEAR_ACCESS_TOKEN and other secrets
31
+ pnpm install
32
+ pnpm dev # Start webhook server
33
+ pnpm worker # Start a local worker (in another terminal)
34
+ ```
35
+
36
+ ## What's Generated
37
+
38
+ ```
39
+ my-agent/
40
+ .env.example # All env vars with comments
41
+ src/lib/config.ts # createAllRoutes() with defaults + customization hints
42
+ src/middleware.ts # Auth, rate limiting, webhook verification
43
+ src/app/webhook/route.ts # Linear webhook endpoint
44
+ src/app/callback/route.ts # OAuth callback
45
+ src/app/api/... # All 21 route re-exports (2-3 lines each)
46
+ src/app/page.tsx # Dashboard UI (optional)
47
+ cli/worker.ts # Local worker wrapper
48
+ cli/orchestrator.ts # Local orchestrator wrapper
49
+ .claude/agents/ # Agent definition templates
50
+ ```
51
+
52
+ ## Options
53
+
54
+ ```
55
+ npx @renseiai/create-agentfactory-app [project-name] [options]
56
+
57
+ Options:
58
+ --team <KEY> Linear team key (default: MY)
59
+ --no-dashboard Skip dashboard UI
60
+ --no-cli Skip CLI tools (worker, orchestrator)
61
+ --no-redis Skip Redis/distributed worker setup
62
+ -h, --help Show help
63
+ ```
64
+
65
+ ## After Setup
66
+
67
+ 1. **Configure Linear webhook** — point it to `https://your-app.vercel.app/webhook`
68
+ 2. **Set webhook secret** — add `LINEAR_WEBHOOK_SECRET` to `.env.local`
69
+ 3. **Customize prompts** — edit `src/lib/config.ts` to change how agents receive instructions
70
+ 4. **Add agent definitions** — edit `.claude/agents/developer.md` for your stack
71
+
72
+ ## Documentation
73
+
74
+ - [Getting Started](https://github.com/renseiai/agentfactory/blob/main/docs/getting-started.md)
75
+ - [Configuration Reference](https://github.com/renseiai/agentfactory/blob/main/docs/configuration.md)
76
+ - [Architecture](https://github.com/renseiai/agentfactory/blob/main/docs/architecture.md)
77
+
78
+ ## License
79
+
80
+ MIT
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * create-agentfactory-app
4
+ *
5
+ * Scaffolds a new AgentFactory app — a Next.js webhook server + worker
6
+ * that processes Linear issues with coding agents.
7
+ *
8
+ * Usage:
9
+ * npx @renseiai/create-agentfactory-app my-agent
10
+ * npx @renseiai/create-agentfactory-app my-agent --team MY
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;GASG"}
@@ -0,0 +1,151 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * create-agentfactory-app
4
+ *
5
+ * Scaffolds a new AgentFactory app — a Next.js webhook server + worker
6
+ * that processes Linear issues with coding agents.
7
+ *
8
+ * Usage:
9
+ * npx @renseiai/create-agentfactory-app my-agent
10
+ * npx @renseiai/create-agentfactory-app my-agent --team MY
11
+ */
12
+ import fs from 'node:fs';
13
+ import path from 'node:path';
14
+ import { execSync } from 'node:child_process';
15
+ import readline from 'node:readline';
16
+ import { getTemplates } from './templates/index.js';
17
+ // ── Argument parsing ────────────────────────────────────────────────
18
+ const args = process.argv.slice(2);
19
+ const flags = {};
20
+ let projectName = '';
21
+ for (let i = 0; i < args.length; i++) {
22
+ const arg = args[i];
23
+ if (arg === '--help' || arg === '-h') {
24
+ printHelp();
25
+ process.exit(0);
26
+ }
27
+ if (arg.startsWith('--')) {
28
+ const key = arg.slice(2);
29
+ flags[key] = args[++i] ?? '';
30
+ }
31
+ else if (!projectName) {
32
+ projectName = arg;
33
+ }
34
+ }
35
+ // ── Interactive prompts ─────────────────────────────────────────────
36
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
37
+ function ask(question, defaultValue) {
38
+ const suffix = defaultValue ? ` (${defaultValue})` : '';
39
+ return new Promise((resolve) => {
40
+ rl.question(` ${question}${suffix}: `, (answer) => {
41
+ resolve(answer.trim() || defaultValue || '');
42
+ });
43
+ });
44
+ }
45
+ function confirm(question, defaultYes = true) {
46
+ const hint = defaultYes ? '[Y/n]' : '[y/N]';
47
+ return new Promise((resolve) => {
48
+ rl.question(` ${question} ${hint}: `, (answer) => {
49
+ const a = answer.trim().toLowerCase();
50
+ if (!a)
51
+ return resolve(defaultYes);
52
+ resolve(a === 'y' || a === 'yes');
53
+ });
54
+ });
55
+ }
56
+ // ── Main ────────────────────────────────────────────────────────────
57
+ async function main() {
58
+ console.log();
59
+ console.log(' create-agentfactory-app');
60
+ console.log();
61
+ // Project name
62
+ if (!projectName) {
63
+ projectName = await ask('Project name', 'my-agent');
64
+ }
65
+ if (!projectName) {
66
+ console.error(' Error: Project name is required');
67
+ process.exit(1);
68
+ }
69
+ // Validate project name
70
+ if (!/^[a-z0-9][a-z0-9._-]*$/.test(projectName)) {
71
+ console.error(' Error: Project name must be lowercase, start with a letter or number');
72
+ process.exit(1);
73
+ }
74
+ const projectDir = path.resolve(process.cwd(), projectName);
75
+ if (fs.existsSync(projectDir)) {
76
+ console.error(` Error: Directory "${projectName}" already exists`);
77
+ process.exit(1);
78
+ }
79
+ // Gather options
80
+ const teamKey = flags['team'] || await ask('Linear team key (e.g., MY)', 'MY');
81
+ const includeDashboard = flags['no-dashboard'] ? false : await confirm('Include dashboard UI?');
82
+ const includeCli = flags['no-cli'] ? false : await confirm('Include CLI tools (worker, orchestrator)?');
83
+ const useRedis = flags['no-redis'] ? false : await confirm('Include Redis for distributed workers?');
84
+ console.log();
85
+ console.log(` Creating ${projectName}...`);
86
+ console.log();
87
+ // Generate files from templates
88
+ const templates = getTemplates({
89
+ projectName,
90
+ teamKey,
91
+ includeDashboard,
92
+ includeCli,
93
+ useRedis,
94
+ });
95
+ // Create directories and write files
96
+ let fileCount = 0;
97
+ for (const [filePath, content] of Object.entries(templates)) {
98
+ const fullPath = path.join(projectDir, filePath);
99
+ fs.mkdirSync(path.dirname(fullPath), { recursive: true });
100
+ fs.writeFileSync(fullPath, content);
101
+ fileCount++;
102
+ }
103
+ console.log(` Created ${fileCount} files`);
104
+ console.log();
105
+ // Initialize git repo
106
+ try {
107
+ execSync('git init', { cwd: projectDir, stdio: 'pipe' });
108
+ console.log(' Initialized git repository');
109
+ }
110
+ catch {
111
+ // Git not available — skip silently
112
+ }
113
+ // Print next steps
114
+ console.log();
115
+ console.log(' Next steps:');
116
+ console.log();
117
+ console.log(` cd ${projectName}`);
118
+ console.log(' cp .env.example .env.local');
119
+ console.log(' # Fill in LINEAR_ACCESS_TOKEN and other secrets');
120
+ console.log(' pnpm install');
121
+ console.log(' pnpm dev # Start webhook server');
122
+ if (includeCli) {
123
+ console.log(' pnpm worker # Start a local worker (in another terminal)');
124
+ }
125
+ console.log();
126
+ console.log(' Documentation: https://github.com/renseiai/agentfactory');
127
+ console.log();
128
+ rl.close();
129
+ }
130
+ function printHelp() {
131
+ console.log(`
132
+ Usage: npx @renseiai/create-agentfactory-app [project-name] [options]
133
+
134
+ Options:
135
+ --team <KEY> Linear team key (default: MY)
136
+ --no-dashboard Skip dashboard UI
137
+ --no-cli Skip CLI tools (worker, orchestrator)
138
+ --no-redis Skip Redis/distributed worker setup
139
+ -h, --help Show this help message
140
+
141
+ Examples:
142
+ npx @renseiai/create-agentfactory-app my-agent
143
+ npx @renseiai/create-agentfactory-app my-agent --team ENG
144
+ npx @renseiai/create-agentfactory-app my-agent --no-dashboard --no-redis
145
+ `);
146
+ }
147
+ main().catch((err) => {
148
+ console.error('Error:', err.message);
149
+ process.exit(1);
150
+ });
151
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,uEAAuE;AAEvE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAClC,MAAM,KAAK,GAA2B,EAAE,CAAA;AACxC,IAAI,WAAW,GAAG,EAAE,CAAA;AAEpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACrC,SAAS,EAAE,CAAA;QACX,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IACD,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACxB,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC9B,CAAC;SAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC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CAAA;IACb,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;IAC5B,OAAO,CAAC,GAAG,EAAE,CAAA;IACb,OAAO,CAAC,GAAG,CAAC,UAAU,WAAW,EAAE,CAAC,CAAA;IACpC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;IAC7C,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAA;IAClE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAC/B,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAA;IAC/D,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAA;IACvF,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,CAAA;IACb,OAAO,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAA;IACxE,OAAO,CAAC,GAAG,EAAE,CAAA;IAEb,EAAE,CAAC,KAAK,EAAE,CAAA;AACZ,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;CAcb,CAAC,CAAA;AACF,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACpC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Template generator for create-agentfactory-app
3
+ *
4
+ * Returns a map of file paths → file contents.
5
+ */
6
+ export interface TemplateOptions {
7
+ projectName: string;
8
+ teamKey: string;
9
+ includeDashboard: boolean;
10
+ includeCli: boolean;
11
+ useRedis: boolean;
12
+ }
13
+ export declare function getTemplates(opts: TemplateOptions): Record<string, string>;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,OAAO,CAAA;IACzB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAyF1E"}
@@ -0,0 +1,790 @@
1
+ /**
2
+ * Template generator for create-agentfactory-app
3
+ *
4
+ * Returns a map of file paths → file contents.
5
+ */
6
+ export function getTemplates(opts) {
7
+ const files = {};
8
+ // ── Root config files ──────────────────────────────────────────
9
+ files['package.json'] = packageJson(opts);
10
+ files['tsconfig.json'] = tsconfig();
11
+ files['next.config.ts'] = nextConfig(opts);
12
+ files['.env.example'] = envExample(opts);
13
+ files['.gitignore'] = gitignore();
14
+ // ── Core app files ─────────────────────────────────────────────
15
+ files['src/lib/config.ts'] = configTs();
16
+ files['src/middleware.ts'] = middlewareTs();
17
+ // ── Route re-exports ───────────────────────────────────────────
18
+ files['src/app/webhook/route.ts'] = routeReexport('routes.webhook.POST', 'routes.webhook.GET');
19
+ files['src/app/callback/route.ts'] = routeReexport(null, 'routes.oauth.callback.GET');
20
+ // Worker routes
21
+ files['src/app/api/workers/register/route.ts'] = routeReexport('routes.workers.register.POST');
22
+ files['src/app/api/workers/route.ts'] = routeReexport(null, 'routes.workers.list.GET');
23
+ files['src/app/api/workers/[id]/route.ts'] = routeReexport(null, 'routes.workers.detail.GET', 'routes.workers.detail.DELETE');
24
+ files['src/app/api/workers/[id]/heartbeat/route.ts'] = routeReexport('routes.workers.heartbeat.POST');
25
+ files['src/app/api/workers/[id]/poll/route.ts'] = routeReexport(null, 'routes.workers.poll.GET');
26
+ // Session routes
27
+ files['src/app/api/sessions/route.ts'] = routeReexport(null, 'routes.sessions.list.GET');
28
+ files['src/app/api/sessions/[id]/route.ts'] = routeReexport(null, 'routes.sessions.detail.GET');
29
+ files['src/app/api/sessions/[id]/claim/route.ts'] = routeReexport('routes.sessions.claim.POST');
30
+ files['src/app/api/sessions/[id]/status/route.ts'] = routeReexport('routes.sessions.status.POST', 'routes.sessions.status.GET');
31
+ files['src/app/api/sessions/[id]/lock-refresh/route.ts'] = routeReexport('routes.sessions.lockRefresh.POST');
32
+ files['src/app/api/sessions/[id]/prompts/route.ts'] = routeReexport('routes.sessions.prompts.POST', 'routes.sessions.prompts.GET');
33
+ files['src/app/api/sessions/[id]/transfer-ownership/route.ts'] = routeReexport('routes.sessions.transferOwnership.POST');
34
+ files['src/app/api/sessions/[id]/activity/route.ts'] = routeReexport('routes.sessions.activity.POST');
35
+ files['src/app/api/sessions/[id]/completion/route.ts'] = routeReexport('routes.sessions.completion.POST');
36
+ files['src/app/api/sessions/[id]/external-urls/route.ts'] = routeReexport('routes.sessions.externalUrls.POST');
37
+ files['src/app/api/sessions/[id]/progress/route.ts'] = routeReexport('routes.sessions.progress.POST');
38
+ files['src/app/api/sessions/[id]/tool-error/route.ts'] = routeReexport('routes.sessions.toolError.POST');
39
+ // Public routes
40
+ files['src/app/api/public/stats/route.ts'] = routeReexport(null, 'routes.public.stats.GET');
41
+ files['src/app/api/public/sessions/route.ts'] = routeReexport(null, 'routes.public.sessions.GET');
42
+ files['src/app/api/public/sessions/[id]/route.ts'] = routeReexport(null, 'routes.public.sessionDetail.GET');
43
+ // Config route
44
+ files['src/app/api/config/route.ts'] = routeReexport(null, 'routes.config.GET');
45
+ // Cleanup route
46
+ files['src/app/api/cleanup/route.ts'] = routeReexport('routes.cleanup.POST', 'routes.cleanup.GET');
47
+ // Issue tracker proxy (centralized API gateway for agents/governors)
48
+ files['src/app/api/issue-tracker-proxy/route.ts'] = routeReexport('routes.issueTrackerProxy.POST', 'routes.issueTrackerProxy.GET');
49
+ // ── Dashboard ──────────────────────────────────────────────────
50
+ if (opts.includeDashboard) {
51
+ files['src/app/layout.tsx'] = layoutTsx(opts);
52
+ files['src/app/page.tsx'] = dashboardPageTsx();
53
+ files['src/app/globals.css'] = globalsCss();
54
+ files['src/app/pipeline/page.tsx'] = pipelinePageTsx();
55
+ files['src/app/sessions/page.tsx'] = sessionsPageTsx();
56
+ files['src/app/sessions/[id]/page.tsx'] = sessionDetailPageTsx();
57
+ files['src/app/settings/page.tsx'] = settingsPageTsx();
58
+ files['postcss.config.mjs'] = postcssConfig();
59
+ }
60
+ else {
61
+ files['src/app/layout.tsx'] = layoutTsx(opts);
62
+ files['src/app/page.tsx'] = minimalPageTsx();
63
+ files['src/app/globals.css'] = globalsCss();
64
+ }
65
+ // ── CLI tools ──────────────────────────────────────────────────
66
+ if (opts.includeCli) {
67
+ files['cli/worker.ts'] = cliWorker();
68
+ files['cli/orchestrator.ts'] = cliOrchestrator();
69
+ files['cli/worker-fleet.ts'] = cliWorkerFleet();
70
+ files['cli/cleanup.ts'] = cliCleanup();
71
+ }
72
+ // ── Agent definitions ──────────────────────────────────────────
73
+ files['.claude/CLAUDE.md'] = claudeMd(opts);
74
+ files['AGENTS.md'] = agentsMd(opts);
75
+ files['.claude/agents/developer.md'] = agentDefinitionDeveloper();
76
+ return files;
77
+ }
78
+ // ── Template helpers ───────────────────────────────────────────────
79
+ function routeReexport(post, get, del) {
80
+ const lines = [`import { routes } from '@/lib/config'`];
81
+ if (post)
82
+ lines.push(`export const POST = ${post}`);
83
+ if (get)
84
+ lines.push(`export const GET = ${get}`);
85
+ if (del)
86
+ lines.push(`export const DELETE = ${del}`);
87
+ return lines.join('\n') + '\n';
88
+ }
89
+ // ── Individual templates ───────────────────────────────────────────
90
+ function packageJson(opts) {
91
+ const deps = {
92
+ '@renseiai/agentfactory': '^0.7.6',
93
+ '@renseiai/agentfactory-cli': '^0.7.6',
94
+ '@renseiai/agentfactory-linear': '^0.7.6',
95
+ '@renseiai/agentfactory-nextjs': '^0.7.6',
96
+ '@renseiai/agentfactory-server': '^0.7.6',
97
+ 'next': '^16.1.0',
98
+ 'react': '^19.0.0',
99
+ 'react-dom': '^19.0.0',
100
+ };
101
+ const devDeps = {
102
+ '@types/node': '^22',
103
+ '@types/react': '^19',
104
+ 'typescript': '^5',
105
+ };
106
+ const scripts = {
107
+ 'dev': 'next dev',
108
+ 'build': 'next build',
109
+ 'start': 'next start',
110
+ 'typecheck': 'tsc --noEmit',
111
+ 'linear': 'af-linear',
112
+ };
113
+ if (opts.includeDashboard) {
114
+ deps['@renseiai/agentfactory-dashboard'] = '^0.7.6';
115
+ devDeps['@tailwindcss/postcss'] = '^4';
116
+ devDeps['tailwindcss'] = '^4';
117
+ }
118
+ if (opts.includeCli) {
119
+ scripts['worker'] = 'tsx cli/worker.ts';
120
+ scripts['orchestrator'] = 'tsx cli/orchestrator.ts';
121
+ scripts['worker-fleet'] = 'tsx cli/worker-fleet.ts';
122
+ scripts['cleanup'] = 'tsx cli/cleanup.ts';
123
+ devDeps['tsx'] = '^4';
124
+ devDeps['dotenv'] = '^16';
125
+ }
126
+ const pkg = {
127
+ name: opts.projectName,
128
+ version: '0.1.0',
129
+ private: true,
130
+ scripts,
131
+ dependencies: deps,
132
+ devDependencies: devDeps,
133
+ };
134
+ return JSON.stringify(pkg, null, 2) + '\n';
135
+ }
136
+ function tsconfig() {
137
+ return JSON.stringify({
138
+ compilerOptions: {
139
+ target: 'ES2017',
140
+ lib: ['dom', 'dom.iterable', 'esnext'],
141
+ allowJs: true,
142
+ skipLibCheck: true,
143
+ strict: true,
144
+ noEmit: true,
145
+ esModuleInterop: true,
146
+ module: 'esnext',
147
+ moduleResolution: 'bundler',
148
+ resolveJsonModule: true,
149
+ isolatedModules: true,
150
+ jsx: 'react-jsx',
151
+ incremental: true,
152
+ baseUrl: '.',
153
+ paths: { '@/*': ['./src/*'] },
154
+ plugins: [{ name: 'next' }],
155
+ },
156
+ include: ['next-env.d.ts', '**/*.ts', '**/*.tsx', '.next/types/**/*.ts'],
157
+ exclude: ['node_modules'],
158
+ }, null, 2) + '\n';
159
+ }
160
+ function nextConfig(opts) {
161
+ if (opts.includeDashboard) {
162
+ return `import type { NextConfig } from 'next'
163
+
164
+ const nextConfig: NextConfig = {
165
+ transpilePackages: ['@renseiai/agentfactory-dashboard'],
166
+ }
167
+
168
+ export default nextConfig
169
+ `;
170
+ }
171
+ return `import type { NextConfig } from 'next'
172
+
173
+ const nextConfig: NextConfig = {}
174
+
175
+ export default nextConfig
176
+ `;
177
+ }
178
+ function envExample(opts) {
179
+ const lines = [
180
+ '# Linear API Access',
181
+ '# Create at: Settings > API > Personal API Keys',
182
+ 'LINEAR_ACCESS_TOKEN=lin_api_...',
183
+ '',
184
+ '# Linear Webhook Verification',
185
+ '# Create at: Settings > API > Webhooks',
186
+ 'LINEAR_WEBHOOK_SECRET=',
187
+ '',
188
+ '# Linear OAuth App (optional — for multi-workspace)',
189
+ '# LINEAR_CLIENT_ID=',
190
+ '# LINEAR_CLIENT_SECRET=',
191
+ '',
192
+ '# App URL (for OAuth redirect)',
193
+ `NEXT_PUBLIC_APP_URL=http://localhost:3000`,
194
+ '',
195
+ ];
196
+ if (opts.useRedis) {
197
+ lines.push('# Redis (required for distributed workers)', '# Format: redis://[:password@]host[:port][/db]', 'REDIS_URL=redis://localhost:6379', '');
198
+ }
199
+ if (opts.includeCli) {
200
+ lines.push('# Worker Configuration', '# WORKER_API_URL=https://your-app.vercel.app', '# WORKER_API_KEY=', '');
201
+ }
202
+ lines.push('# Agent Provider (default: claude)', '# Options: claude, codex, amp', '# AGENT_PROVIDER=claude', '', '# Auto-trigger Configuration', '# ENABLE_AUTO_QA=false', '# ENABLE_AUTO_ACCEPTANCE=false');
203
+ return lines.join('\n') + '\n';
204
+ }
205
+ function gitignore() {
206
+ return `node_modules/
207
+ .next/
208
+ dist/
209
+ .env.local
210
+ .env*.local
211
+ .worktrees/
212
+ .agent/
213
+ *.tsbuildinfo
214
+ `;
215
+ }
216
+ function configTs() {
217
+ return `/**
218
+ * AgentFactory Configuration
219
+ *
220
+ * Central route wiring — connects your callbacks to the route factories.
221
+ * Customize generatePrompt and other hooks to match your workflow.
222
+ */
223
+
224
+ import { createAllRoutes, createDefaultLinearClientResolver } from '@renseiai/agentfactory-nextjs'
225
+
226
+ export const routes = createAllRoutes({
227
+ linearClient: createDefaultLinearClientResolver(),
228
+ // Uncomment and customize as needed:
229
+ // projects: ['MyProject'], // Only handle webhooks for these Linear projects
230
+ // generatePrompt: (identifier, workType, mentionContext) => {
231
+ // return \`Work on issue \${identifier} (type: \${workType})\`
232
+ // },
233
+ // autoTrigger: {
234
+ // enableAutoQA: true,
235
+ // enableAutoAcceptance: false,
236
+ // autoQARequireAgentWorked: true,
237
+ // autoAcceptanceRequireAgentWorked: true,
238
+ // autoQAProjects: [],
239
+ // autoAcceptanceProjects: [],
240
+ // autoQAExcludeLabels: [],
241
+ // autoAcceptanceExcludeLabels: [],
242
+ // },
243
+ })
244
+ `;
245
+ }
246
+ function middlewareTs() {
247
+ return `/**
248
+ * Next.js Middleware — Edge Runtime Compatible
249
+ *
250
+ * Uses the /middleware subpath export which only loads Edge-compatible
251
+ * modules. Do NOT import from the main barrel ('@renseiai/agentfactory-nextjs')
252
+ * — it pulls in Node.js-only dependencies via re-exports.
253
+ */
254
+
255
+ import { createAgentFactoryMiddleware } from '@renseiai/agentfactory-nextjs/middleware'
256
+
257
+ const { middleware } = createAgentFactoryMiddleware()
258
+
259
+ export { middleware }
260
+
261
+ // Must be a static object literal for Next.js build analysis
262
+ export const config = {
263
+ matcher: [
264
+ '/api/:path*',
265
+ '/webhook',
266
+ '/pipeline',
267
+ '/settings',
268
+ '/sessions/:path*',
269
+ '/',
270
+ ],
271
+ }
272
+ `;
273
+ }
274
+ function layoutTsx(opts) {
275
+ if (opts.includeDashboard) {
276
+ return `import type { Metadata } from 'next'
277
+ import '@renseiai/agentfactory-dashboard/styles'
278
+ import './globals.css'
279
+
280
+ export const metadata: Metadata = {
281
+ title: '${opts.projectName} — AgentFactory',
282
+ description: 'AI agent fleet management',
283
+ }
284
+
285
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
286
+ return (
287
+ <html lang="en" className="dark">
288
+ <body className="antialiased">{children}</body>
289
+ </html>
290
+ )
291
+ }
292
+ `;
293
+ }
294
+ return `import type { Metadata } from 'next'
295
+ import './globals.css'
296
+
297
+ export const metadata: Metadata = {
298
+ title: '${opts.projectName} — AgentFactory',
299
+ description: 'AI agent fleet management',
300
+ }
301
+
302
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
303
+ return (
304
+ <html lang="en">
305
+ <body>{children}</body>
306
+ </html>
307
+ )
308
+ }
309
+ `;
310
+ }
311
+ function globalsCss() {
312
+ return `@import "tailwindcss";
313
+ @source "../../node_modules/@renseiai/agentfactory-dashboard/src";
314
+ `;
315
+ }
316
+ function dashboardPageTsx() {
317
+ return `'use client'
318
+
319
+ import { DashboardShell, DashboardPage as FleetPage } from '@renseiai/agentfactory-dashboard'
320
+ import { usePathname } from 'next/navigation'
321
+
322
+ export default function DashboardPage() {
323
+ const pathname = usePathname()
324
+ return (
325
+ <DashboardShell currentPath={pathname}>
326
+ <FleetPage />
327
+ </DashboardShell>
328
+ )
329
+ }
330
+ `;
331
+ }
332
+ function pipelinePageTsx() {
333
+ return `'use client'
334
+
335
+ import { DashboardShell, PipelinePage } from '@renseiai/agentfactory-dashboard'
336
+ import { usePathname } from 'next/navigation'
337
+
338
+ export default function Pipeline() {
339
+ const pathname = usePathname()
340
+ return (
341
+ <DashboardShell currentPath={pathname}>
342
+ <PipelinePage />
343
+ </DashboardShell>
344
+ )
345
+ }
346
+ `;
347
+ }
348
+ function sessionsPageTsx() {
349
+ return `'use client'
350
+
351
+ import { DashboardShell, SessionPage } from '@renseiai/agentfactory-dashboard'
352
+ import { usePathname } from 'next/navigation'
353
+
354
+ export default function Sessions() {
355
+ const pathname = usePathname()
356
+ return (
357
+ <DashboardShell currentPath={pathname}>
358
+ <SessionPage />
359
+ </DashboardShell>
360
+ )
361
+ }
362
+ `;
363
+ }
364
+ function sessionDetailPageTsx() {
365
+ return `'use client'
366
+
367
+ import { DashboardShell, SessionPage } from '@renseiai/agentfactory-dashboard'
368
+ import { usePathname, useParams } from 'next/navigation'
369
+
370
+ export default function SessionDetailPage() {
371
+ const pathname = usePathname()
372
+ const params = useParams<{ id: string }>()
373
+ return (
374
+ <DashboardShell currentPath={pathname}>
375
+ <SessionPage sessionId={params.id} />
376
+ </DashboardShell>
377
+ )
378
+ }
379
+ `;
380
+ }
381
+ function settingsPageTsx() {
382
+ return `'use client'
383
+
384
+ import { DashboardShell, SettingsPage } from '@renseiai/agentfactory-dashboard'
385
+ import { usePathname } from 'next/navigation'
386
+
387
+ export default function Settings() {
388
+ const pathname = usePathname()
389
+ return (
390
+ <DashboardShell currentPath={pathname}>
391
+ <SettingsPage />
392
+ </DashboardShell>
393
+ )
394
+ }
395
+ `;
396
+ }
397
+ function postcssConfig() {
398
+ return `export default {
399
+ plugins: {
400
+ "@tailwindcss/postcss": {},
401
+ },
402
+ }
403
+ `;
404
+ }
405
+ function minimalPageTsx() {
406
+ return `export default function HomePage() {
407
+ return (
408
+ <main style={{ padding: '2rem', fontFamily: 'system-ui' }}>
409
+ <h1>AgentFactory</h1>
410
+ <p>Webhook server is running. Configure your Linear webhook to point to <code>/webhook</code>.</p>
411
+ </main>
412
+ )
413
+ }
414
+ `;
415
+ }
416
+ function cliWorker() {
417
+ return `#!/usr/bin/env tsx
418
+ import path from 'path'
419
+ import { config } from 'dotenv'
420
+
421
+ config({ path: path.resolve(import.meta.dirname, '..', '.env.local') })
422
+
423
+ import { runWorker } from '@renseiai/agentfactory-cli/worker'
424
+
425
+ function parseArgs() {
426
+ const args = process.argv.slice(2)
427
+ const opts: Record<string, string | boolean> = {}
428
+ for (let i = 0; i < args.length; i++) {
429
+ const arg = args[i]
430
+ if (arg === '--capacity' && args[i + 1]) opts.capacity = args[++i]
431
+ else if (arg === '--hostname' && args[i + 1]) opts.hostname = args[++i]
432
+ else if (arg === '--api-url' && args[i + 1]) opts.apiUrl = args[++i]
433
+ else if (arg === '--projects' && args[i + 1]) opts.projects = args[++i]
434
+ else if (arg === '--dry-run') opts.dryRun = true
435
+ }
436
+ return opts
437
+ }
438
+
439
+ const args = parseArgs()
440
+
441
+ const apiUrl = (args.apiUrl as string) || process.env.WORKER_API_URL
442
+ const apiKey = process.env.WORKER_API_KEY
443
+
444
+ if (!apiUrl) {
445
+ console.error('Error: WORKER_API_URL not set (use --api-url or env)')
446
+ process.exit(1)
447
+ }
448
+ if (!apiKey) {
449
+ console.error('Error: WORKER_API_KEY not set')
450
+ process.exit(1)
451
+ }
452
+
453
+ const controller = new AbortController()
454
+ process.on('SIGINT', () => controller.abort())
455
+ process.on('SIGTERM', () => controller.abort())
456
+
457
+ const capacity = args.capacity
458
+ ? Number(args.capacity)
459
+ : process.env.WORKER_CAPACITY
460
+ ? Number(process.env.WORKER_CAPACITY)
461
+ : undefined
462
+
463
+ const projects = (args.projects as string)
464
+ ? (args.projects as string).split(',').map(s => s.trim()).filter(Boolean)
465
+ : process.env.WORKER_PROJECTS
466
+ ? process.env.WORKER_PROJECTS.split(',').map(s => s.trim()).filter(Boolean)
467
+ : undefined
468
+
469
+ runWorker(
470
+ {
471
+ apiUrl,
472
+ apiKey,
473
+ hostname: args.hostname as string | undefined,
474
+ capacity,
475
+ dryRun: !!args.dryRun,
476
+ projects,
477
+ },
478
+ controller.signal,
479
+ ).catch((err) => {
480
+ if (err?.name !== 'AbortError') {
481
+ console.error('Worker failed:', err)
482
+ process.exit(1)
483
+ }
484
+ })
485
+ `;
486
+ }
487
+ function cliOrchestrator() {
488
+ return `#!/usr/bin/env tsx
489
+ import path from 'path'
490
+ import { config } from 'dotenv'
491
+
492
+ config({ path: path.resolve(import.meta.dirname, '..', '.env.local') })
493
+
494
+ import { runOrchestrator } from '@renseiai/agentfactory-cli/orchestrator'
495
+
496
+ function parseArgs() {
497
+ const args = process.argv.slice(2)
498
+ const opts: Record<string, string | boolean> = {}
499
+ for (let i = 0; i < args.length; i++) {
500
+ const arg = args[i]
501
+ if (arg === '--project' && args[i + 1]) opts.project = args[++i]
502
+ else if (arg === '--max' && args[i + 1]) opts.max = args[++i]
503
+ else if (arg === '--single' && args[i + 1]) opts.single = args[++i]
504
+ else if (arg === '--no-wait') opts.wait = false
505
+ else if (arg === '--dry-run') opts.dryRun = true
506
+ }
507
+ return opts
508
+ }
509
+
510
+ const args = parseArgs()
511
+
512
+ const linearApiKey = process.env.LINEAR_API_KEY || process.env.LINEAR_ACCESS_TOKEN
513
+ if (!linearApiKey) {
514
+ console.error('Error: LINEAR_API_KEY or LINEAR_ACCESS_TOKEN not set')
515
+ process.exit(1)
516
+ }
517
+
518
+ runOrchestrator({
519
+ linearApiKey,
520
+ project: args.project as string | undefined,
521
+ max: args.max ? Number(args.max) : undefined,
522
+ single: args.single as string | undefined,
523
+ wait: args.wait !== false,
524
+ dryRun: !!args.dryRun,
525
+ }).then((result) => {
526
+ if (result.errors.length > 0) process.exit(1)
527
+ }).catch((err) => {
528
+ console.error('Orchestrator failed:', err)
529
+ process.exit(1)
530
+ })
531
+ `;
532
+ }
533
+ function cliWorkerFleet() {
534
+ return `#!/usr/bin/env tsx
535
+ import path from 'path'
536
+ import { config } from 'dotenv'
537
+
538
+ config({ path: path.resolve(import.meta.dirname, '..', '.env.local') })
539
+
540
+ import { runWorkerFleet } from '@renseiai/agentfactory-cli/worker-fleet'
541
+
542
+ function parseArgs() {
543
+ const args = process.argv.slice(2)
544
+ const opts: Record<string, string | boolean> = {}
545
+ for (let i = 0; i < args.length; i++) {
546
+ const arg = args[i]
547
+ if (arg === '--workers' && args[i + 1]) opts.workers = args[++i]
548
+ else if (arg === '--capacity' && args[i + 1]) opts.capacity = args[++i]
549
+ else if (arg === '--projects' && args[i + 1]) opts.projects = args[++i]
550
+ else if (arg === '--dry-run') opts.dryRun = true
551
+ }
552
+ return opts
553
+ }
554
+
555
+ const args = parseArgs()
556
+
557
+ const apiUrl = process.env.WORKER_API_URL
558
+ const apiKey = process.env.WORKER_API_KEY
559
+
560
+ if (!apiUrl) {
561
+ console.error('Error: WORKER_API_URL not set')
562
+ process.exit(1)
563
+ }
564
+ if (!apiKey) {
565
+ console.error('Error: WORKER_API_KEY not set')
566
+ process.exit(1)
567
+ }
568
+
569
+ const controller = new AbortController()
570
+ process.on('SIGINT', () => controller.abort())
571
+ process.on('SIGTERM', () => controller.abort())
572
+
573
+ const workers = args.workers
574
+ ? Number(args.workers)
575
+ : process.env.WORKER_FLEET_SIZE
576
+ ? Number(process.env.WORKER_FLEET_SIZE)
577
+ : undefined
578
+ const capacity = args.capacity
579
+ ? Number(args.capacity)
580
+ : process.env.WORKER_CAPACITY
581
+ ? Number(process.env.WORKER_CAPACITY)
582
+ : undefined
583
+ const projects = (args.projects as string)
584
+ ? (args.projects as string).split(',').map(s => s.trim()).filter(Boolean)
585
+ : process.env.WORKER_PROJECTS
586
+ ? process.env.WORKER_PROJECTS.split(',').map(s => s.trim()).filter(Boolean)
587
+ : undefined
588
+
589
+ runWorkerFleet(
590
+ {
591
+ apiUrl,
592
+ apiKey,
593
+ workers,
594
+ capacity,
595
+ dryRun: !!args.dryRun,
596
+ projects,
597
+ },
598
+ controller.signal,
599
+ ).catch((err) => {
600
+ if (err?.name !== 'AbortError') {
601
+ console.error('Fleet failed:', err)
602
+ process.exit(1)
603
+ }
604
+ })
605
+ `;
606
+ }
607
+ function cliCleanup() {
608
+ return `#!/usr/bin/env tsx
609
+ import { runCleanup, type CleanupRunnerConfig } from '@renseiai/agentfactory-cli/cleanup'
610
+
611
+ function parseArgs(): CleanupRunnerConfig {
612
+ const args = process.argv.slice(2)
613
+ const opts: CleanupRunnerConfig = {}
614
+ for (let i = 0; i < args.length; i++) {
615
+ const arg = args[i]
616
+ if (arg === '--dry-run') opts.dryRun = true
617
+ else if (arg === '--force') opts.force = true
618
+ else if (arg === '--path' && args[i + 1]) opts.worktreePath = args[++i]
619
+ else if (arg === '--help' || arg === '-h') {
620
+ console.log('Usage: pnpm cleanup [--dry-run] [--force] [--path <dir>]')
621
+ process.exit(0)
622
+ }
623
+ }
624
+ return opts
625
+ }
626
+
627
+ const result = runCleanup(parseArgs())
628
+
629
+ console.log(\`\\nSummary: scanned=\${result.scanned} orphaned=\${result.orphaned} cleaned=\${result.cleaned}\`)
630
+ if (result.errors.length > 0) {
631
+ console.error('Errors:', result.errors)
632
+ process.exit(1)
633
+ }
634
+ `;
635
+ }
636
+ function claudeMd(opts) {
637
+ return `# ${opts.projectName}
638
+
639
+ AgentFactory-powered project. Uses Linear for issue tracking.
640
+
641
+ ## Linear CLI
642
+
643
+ Use \`pnpm af-linear\` (or \`af-linear\`) for ALL Linear operations. All commands return JSON to stdout.
644
+
645
+ \`\`\`bash
646
+ # Issue operations
647
+ pnpm af-linear get-issue <id>
648
+ pnpm af-linear create-issue --title "Title" --team "${opts.teamKey}" [--description "..."] [--project "..."] [--labels "Label1,Label2"] [--state "Backlog"] [--parentId "..."]
649
+ pnpm af-linear update-issue <id> [--title "..."] [--description "..."] [--state "..."] [--labels "..."]
650
+
651
+ # Comments
652
+ pnpm af-linear list-comments <issue-id>
653
+ pnpm af-linear create-comment <issue-id> --body "Comment text"
654
+
655
+ # Relations
656
+ pnpm af-linear add-relation <issue-id> <related-issue-id> --type <related|blocks|duplicate>
657
+ pnpm af-linear list-relations <issue-id>
658
+ pnpm af-linear remove-relation <relation-id>
659
+
660
+ # Sub-issues
661
+ pnpm af-linear list-sub-issues <parent-issue-id>
662
+ pnpm af-linear list-sub-issue-statuses <parent-issue-id>
663
+ pnpm af-linear update-sub-issue <id> [--state "Finished"] [--comment "Done"]
664
+
665
+ # Backlog
666
+ pnpm af-linear check-blocked <issue-id>
667
+ pnpm af-linear list-backlog-issues --project "ProjectName"
668
+ pnpm af-linear list-unblocked-backlog --project "ProjectName"
669
+
670
+ # Deployment
671
+ pnpm af-linear check-deployment <pr-number> [--format json|markdown]
672
+ \`\`\`
673
+
674
+ ### Key Rules
675
+
676
+ - \`--team\` is always required for \`create-issue\`
677
+ - Use \`--state\` not \`--status\`
678
+ - Use label names not UUIDs
679
+ - \`--labels\` accepts comma-separated values
680
+ - All commands return JSON to stdout
681
+
682
+ ## Environment
683
+
684
+ Requires \`LINEAR_API_KEY\` or \`LINEAR_ACCESS_TOKEN\` in \`.env.local\`.
685
+
686
+ ## Build & Test
687
+
688
+ \`\`\`bash
689
+ pnpm dev # Start dev server
690
+ pnpm build # Production build
691
+ pnpm typecheck # Type-check
692
+ pnpm test # Run tests
693
+ \`\`\`
694
+ `;
695
+ }
696
+ function agentsMd(opts) {
697
+ return `# ${opts.projectName}
698
+
699
+ AgentFactory-powered project. Uses Linear for issue tracking.
700
+ This file is used by OpenAI Codex agents (equivalent to .claude/CLAUDE.md for Claude agents).
701
+
702
+ ## Linear CLI
703
+
704
+ Use \`pnpm af-linear\` for ALL Linear operations. All commands return JSON to stdout.
705
+
706
+ \`\`\`bash
707
+ pnpm af-linear get-issue <id>
708
+ pnpm af-linear create-issue --title "Title" --team "${opts.teamKey}" [--description "..."]
709
+ pnpm af-linear update-issue <id> [--title "..."] [--description "..."] [--state "..."]
710
+ pnpm af-linear create-comment <issue-id> --body "Comment text"
711
+ \`\`\`
712
+
713
+ ### Key Rules
714
+
715
+ - \`--team\` is always required for \`create-issue\`
716
+ - Use \`--state\` not \`--status\`
717
+ - Use label names not UUIDs
718
+ - All commands return JSON to stdout
719
+
720
+ ## Build & Test
721
+
722
+ \`\`\`bash
723
+ pnpm dev # Start dev server
724
+ pnpm build # Production build
725
+ pnpm typecheck # Type-check
726
+ pnpm test # Run tests
727
+ \`\`\`
728
+ `;
729
+ }
730
+ function agentDefinitionDeveloper() {
731
+ return `# Developer Agent
732
+
733
+ You are a coding agent working on issues from the project backlog.
734
+
735
+ ## Workflow
736
+
737
+ 1. Read the issue requirements carefully
738
+ 2. Explore the existing codebase to understand patterns
739
+ 3. Implement the feature or fix
740
+ 4. Write tests if the project has a test framework
741
+ 5. Run \`pnpm test\` and \`pnpm typecheck\` to verify
742
+ 6. Create a PR with a clear description
743
+ 7. Update the Linear issue status
744
+
745
+ ## Linear Status Updates
746
+
747
+ \`\`\`bash
748
+ # Mark issue as started when you begin work
749
+ pnpm af-linear update-issue <id> --state "Started"
750
+
751
+ # Post progress updates
752
+ pnpm af-linear create-comment <issue-id> --body "Implementation complete, running tests"
753
+
754
+ # Mark as finished when PR is created
755
+ pnpm af-linear update-issue <id> --state "Finished"
756
+ \`\`\`
757
+
758
+ ## PR Creation
759
+
760
+ After completing the implementation:
761
+
762
+ \`\`\`bash
763
+ git add <files>
764
+ git commit -m "<issue-id>: <description>"
765
+ gh pr create --title "<issue-id>: <description>" --body "Resolves <issue-id>"
766
+ \`\`\`
767
+
768
+ ## Work Result
769
+
770
+ End your work with a comment indicating the result:
771
+
772
+ \`\`\`
773
+ <!-- WORK_RESULT:passed -->
774
+ \`\`\`
775
+
776
+ Or if the work failed:
777
+
778
+ \`\`\`
779
+ <!-- WORK_RESULT:failed -->
780
+ \`\`\`
781
+
782
+ ## Guidelines
783
+
784
+ - Follow existing code patterns and conventions
785
+ - Keep changes focused on the issue requirements
786
+ - Don't refactor unrelated code
787
+ - Write clear commit messages
788
+ `;
789
+ }
790
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,MAAM,UAAU,YAAY,CAAC,IAAqB;IAChD,MAAM,KAAK,GAA2B,EAAE,CAAA;IAExC,kEAAkE;IAElE,KAAK,CAAC,cAAc,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;IACzC,KAAK,CAAC,eAAe,CAAC,GAAG,QAAQ,EAAE,CAAA;IACnC,KAAK,CAAC,gBAAgB,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;IAC1C,KAAK,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;IACxC,KAAK,CA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;;;;;;;;;;;;;;;;;;;;;;;;;CA8CjE,CAAA;AACD,CAAC;AAED,SAAS,QAAQ,CAAC,IAAqB;IACrC,OAAO,KAAK,IAAI,CAAC,WAAW;;;;;;;;;;;sDAWwB,IAAI,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;CAoBjE,CAAA;AACD,CAAC;AAED,SAAS,wBAAwB;IAC/B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDR,CAAA;AACD,CAAC"}
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@renseiai/create-agentfactory-app",
3
+ "version": "0.8.0",
4
+ "type": "module",
5
+ "description": "Create an AgentFactory app — multi-agent fleet management for coding agents",
6
+ "author": "Rensei AI (https://rensei.ai)",
7
+ "license": "MIT",
8
+ "engines": {
9
+ "node": ">=22.0.0"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/renseiai/agentfactory",
14
+ "directory": "packages/create-app"
15
+ },
16
+ "homepage": "https://github.com/renseiai/agentfactory/tree/main/packages/create-app",
17
+ "bugs": {
18
+ "url": "https://github.com/renseiai/agentfactory/issues"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "keywords": [
24
+ "create",
25
+ "agentfactory",
26
+ "ai-agents",
27
+ "coding-agents",
28
+ "linear",
29
+ "scaffolding"
30
+ ],
31
+ "bin": {
32
+ "create-agentfactory-app": "./dist/src/index.js"
33
+ },
34
+ "main": "./dist/src/index.js",
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/src/index.d.ts",
38
+ "import": "./dist/src/index.js",
39
+ "default": "./dist/src/index.js"
40
+ },
41
+ "./templates": {
42
+ "types": "./dist/src/templates/index.d.ts",
43
+ "import": "./dist/src/templates/index.js",
44
+ "default": "./dist/src/templates/index.js"
45
+ }
46
+ },
47
+ "files": [
48
+ "dist",
49
+ "README.md",
50
+ "LICENSE"
51
+ ],
52
+ "dependencies": {},
53
+ "devDependencies": {
54
+ "@types/node": "^22.5.4",
55
+ "typescript": "^5.7.3"
56
+ },
57
+ "scripts": {
58
+ "build": "tsc",
59
+ "typecheck": "tsc --noEmit",
60
+ "clean": "rm -rf dist",
61
+ "prepublishOnly": "pnpm clean && pnpm build"
62
+ }
63
+ }