@zweer/dev 1.2.0 → 2.0.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/README.md +68 -467
- package/configs/_biome.json +38 -0
- package/configs/commitlint.config.ts +1 -0
- package/configs/editorconfig +16 -0
- package/configs/lefthook.yml +38 -0
- package/configs/lockfile-lintrc.json +6 -0
- package/configs/npmpackagejsonlintrc.json +34 -0
- package/configs/tsconfig.json +9 -0
- package/configs/tsdown.config.ts +8 -0
- package/configs/vitest.config.ts +12 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +247 -0
- package/dist/index.mjs.map +1 -0
- package/kiro/agents/zweer-setup.json +38 -0
- package/kiro/prompts/zweer-setup.md +55 -0
- package/kiro/skills/agent-template/SKILL.md +22 -0
- package/kiro/skills/agent-template/references/base.json +38 -0
- package/kiro/skills/agent-template/references/example-monorepo-library.json +60 -0
- package/kiro/skills/agent-template/references/example-webapp-vercel.json +54 -0
- package/kiro/skills/prompt-template/SKILL.md +23 -0
- package/kiro/skills/prompt-template/references/example-library.md +56 -0
- package/kiro/skills/prompt-template/references/example-webapp.md +57 -0
- package/kiro/skills/skill-templates/SKILL.md +23 -0
- package/kiro/skills/skill-templates/references/new-package.md +72 -0
- package/kiro/skills/steering-templates/SKILL.md +31 -0
- package/kiro/skills/steering-templates/references/build-tooling.md +62 -0
- package/kiro/skills/steering-templates/references/code-style.md +83 -0
- package/kiro/skills/steering-templates/references/commit-conventions.md +58 -0
- package/kiro/skills/steering-templates/references/interaction.md +41 -0
- package/kiro/skills/steering-templates/references/testing.md +61 -0
- package/kiro/steering/build-tooling.md +62 -0
- package/kiro/steering/code-style.md +83 -0
- package/kiro/steering/commit-conventions.md +58 -0
- package/kiro/steering/interaction.md +41 -0
- package/kiro/steering/testing.md +61 -0
- package/package.json +42 -57
- package/templates/monorepo/CHANGELOG.md +5 -0
- package/templates/monorepo/README.md +22 -0
- package/templates/monorepo/package.json +30 -0
- package/templates/monorepo/packages/core/CHANGELOG.md +5 -0
- package/templates/monorepo/packages/core/README.md +21 -0
- package/templates/monorepo/packages/core/package.json +28 -0
- package/templates/monorepo/packages/core/src/index.ts +3 -0
- package/templates/monorepo/packages/core/test/index.test.ts +9 -0
- package/templates/monorepo/tsdown.config.ts +12 -0
- package/templates/monorepo/vitest.config.ts +12 -0
- package/templates/single/CHANGELOG.md +5 -0
- package/templates/single/README.md +30 -0
- package/templates/single/package.json +38 -0
- package/templates/single/src/index.ts +3 -0
- package/templates/single/test/index.test.ts +9 -0
- package/templates/single/tsdown.config.ts +11 -0
- package/workflows/base/ci.yml +24 -0
- package/workflows/base/dependabot-auto-merge.yml +43 -0
- package/workflows/base/dependabot-lockfile.yml +34 -0
- package/workflows/base/dependabot.yml +39 -0
- package/workflows/base/pr.yml +41 -0
- package/workflows/base/security.yml +25 -0
- package/workflows/docs/docs.yml +47 -0
- package/workflows/library/npm.yml +45 -0
- package/agents/data/zweer_data_engineer.md +0 -436
- package/agents/design/zweer_ui_designer.md +0 -171
- package/agents/design/zweer_ui_ux.md +0 -124
- package/agents/infrastructure/zweer_infra_cdk.md +0 -701
- package/agents/infrastructure/zweer_infra_devops.md +0 -148
- package/agents/infrastructure/zweer_infra_observability.md +0 -610
- package/agents/infrastructure/zweer_infra_terraform.md +0 -658
- package/agents/mobile/zweer_mobile_android.md +0 -636
- package/agents/mobile/zweer_mobile_flutter.md +0 -623
- package/agents/mobile/zweer_mobile_ionic.md +0 -550
- package/agents/mobile/zweer_mobile_ios.md +0 -504
- package/agents/mobile/zweer_mobile_react_native.md +0 -561
- package/agents/quality/zweer_qa_documentation.md +0 -202
- package/agents/quality/zweer_qa_performance.md +0 -160
- package/agents/quality/zweer_qa_security.md +0 -197
- package/agents/quality/zweer_qa_testing.md +0 -189
- package/agents/services/zweer_svc_api_gateway.md +0 -553
- package/agents/services/zweer_svc_containers.md +0 -575
- package/agents/services/zweer_svc_lambda.md +0 -373
- package/agents/services/zweer_svc_messaging.md +0 -543
- package/agents/services/zweer_svc_microservices.md +0 -502
- package/agents/web/zweer_web_api_integration.md +0 -500
- package/agents/web/zweer_web_backend.md +0 -358
- package/agents/web/zweer_web_database.md +0 -357
- package/agents/web/zweer_web_frontend.md +0 -375
- package/agents/web/zweer_web_reader.md +0 -229
- package/agents/write/zweer_write_content.md +0 -499
- package/agents/write/zweer_write_narrative.md +0 -409
- package/agents/write/zweer_write_style.md +0 -247
- package/agents/write/zweer_write_warmth.md +0 -282
- package/cli/commands/bootstrap.d.ts +0 -4
- package/cli/commands/bootstrap.js +0 -377
- package/cli/commands/cao/agent/create.d.ts +0 -17
- package/cli/commands/cao/agent/create.js +0 -89
- package/cli/commands/cao/agent/index.d.ts +0 -2
- package/cli/commands/cao/agent/index.js +0 -8
- package/cli/commands/cao/agent/list.d.ts +0 -3
- package/cli/commands/cao/agent/list.js +0 -29
- package/cli/commands/cao/agent/remove.d.ts +0 -5
- package/cli/commands/cao/agent/remove.js +0 -39
- package/cli/commands/cao/index.d.ts +0 -2
- package/cli/commands/cao/index.js +0 -18
- package/cli/commands/cao/init.d.ts +0 -15
- package/cli/commands/cao/init.js +0 -87
- package/cli/commands/cao/install.d.ts +0 -10
- package/cli/commands/cao/install.js +0 -59
- package/cli/commands/cao/launch.d.ts +0 -3
- package/cli/commands/cao/launch.js +0 -21
- package/cli/commands/cao/list.d.ts +0 -4
- package/cli/commands/cao/list.js +0 -28
- package/cli/commands/cao/server.d.ts +0 -3
- package/cli/commands/cao/server.js +0 -20
- package/cli/commands/cao/sync.d.ts +0 -6
- package/cli/commands/cao/sync.js +0 -52
- package/cli/commands/setup.d.ts +0 -4
- package/cli/commands/setup.js +0 -346
- package/cli/index.d.ts +0 -2
- package/cli/index.js +0 -13
- package/cli/utils/agents.d.ts +0 -8
- package/cli/utils/agents.js +0 -55
- package/cli/utils/cao.d.ts +0 -9
- package/cli/utils/cao.js +0 -40
- package/cli/utils/paths.d.ts +0 -5
- package/cli/utils/paths.js +0 -11
- package/templates/orchestrator.md +0 -190
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"rules": {
|
|
3
|
+
"require-author": "error",
|
|
4
|
+
"require-description": "error",
|
|
5
|
+
"require-engines": "error",
|
|
6
|
+
"require-license": "error",
|
|
7
|
+
"require-name": "error",
|
|
8
|
+
"require-repository": "error",
|
|
9
|
+
"require-version": "error",
|
|
10
|
+
"require-bugs": "error",
|
|
11
|
+
"require-homepage": "error",
|
|
12
|
+
"require-keywords": "error",
|
|
13
|
+
"bin-type": "error",
|
|
14
|
+
"config-type": "error",
|
|
15
|
+
"description-type": "error",
|
|
16
|
+
"devDependencies-type": "error",
|
|
17
|
+
"directories-type": "error",
|
|
18
|
+
"engines-type": "error",
|
|
19
|
+
"files-type": "error",
|
|
20
|
+
"homepage-type": "error",
|
|
21
|
+
"keywords-type": "error",
|
|
22
|
+
"license-type": "error",
|
|
23
|
+
"main-type": "error",
|
|
24
|
+
"man-type": "error",
|
|
25
|
+
"name-type": "error",
|
|
26
|
+
"preferGlobal-type": "error",
|
|
27
|
+
"private-type": "error",
|
|
28
|
+
"repository-type": "error",
|
|
29
|
+
"scripts-type": "error",
|
|
30
|
+
"version-type": "error",
|
|
31
|
+
"name-format": "error",
|
|
32
|
+
"version-format": "error"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
coverage: {
|
|
6
|
+
provider: 'v8',
|
|
7
|
+
reporter: ['text', 'json', 'json-summary'],
|
|
8
|
+
include: ['src/**/*.ts'],
|
|
9
|
+
exclude: ['**/index.ts', '**/types.ts'],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
});
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { Command } from "@commander-js/extra-typings";
|
|
6
|
+
import { exec } from "node:child_process";
|
|
7
|
+
import { access, copyFile, cp, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
8
|
+
import { promisify } from "node:util";
|
|
9
|
+
import { homedir } from "node:os";
|
|
10
|
+
//#region cli/utils/paths.ts
|
|
11
|
+
const __dirname$1 = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const paths = {
|
|
13
|
+
root: join(__dirname$1, "../.."),
|
|
14
|
+
configs: join(__dirname$1, "../../configs"),
|
|
15
|
+
kiro: join(__dirname$1, "../../kiro"),
|
|
16
|
+
workflows: join(__dirname$1, "../../workflows")
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region cli/utils/configs.ts
|
|
20
|
+
async function fileExists(path) {
|
|
21
|
+
try {
|
|
22
|
+
await access(path);
|
|
23
|
+
return true;
|
|
24
|
+
} catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const CONFIG_FILES = [
|
|
29
|
+
{
|
|
30
|
+
src: "_biome.json",
|
|
31
|
+
dest: "biome.json"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
src: "editorconfig",
|
|
35
|
+
dest: ".editorconfig"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
src: "commitlint.config.ts",
|
|
39
|
+
dest: "commitlint.config.ts"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
src: "lefthook.yml",
|
|
43
|
+
dest: "lefthook.yml"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
src: "lockfile-lintrc.json",
|
|
47
|
+
dest: ".lockfile-lintrc.json"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
src: "npmpackagejsonlintrc.json",
|
|
51
|
+
dest: ".npmpackagejsonlintrc.json"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
src: "tsconfig.json",
|
|
55
|
+
dest: "tsconfig.json"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
src: "tsdown.config.ts",
|
|
59
|
+
dest: "tsdown.config.ts"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
src: "vitest.config.ts",
|
|
63
|
+
dest: "vitest.config.ts"
|
|
64
|
+
}
|
|
65
|
+
];
|
|
66
|
+
async function copyConfig(file, targetDir) {
|
|
67
|
+
const dest = join(targetDir, file.dest);
|
|
68
|
+
if (await fileExists(dest)) return false;
|
|
69
|
+
await copyFile(join(paths.configs, file.src), dest);
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
async function copyWorkflows(tier, targetDir) {
|
|
73
|
+
const srcDir = join(paths.workflows, tier);
|
|
74
|
+
const destDir = join(targetDir, ".github/workflows");
|
|
75
|
+
await mkdir(destDir, { recursive: true });
|
|
76
|
+
for (const file of await readdir(srcDir)) {
|
|
77
|
+
const destFile = file === "dependabot.yml" ? join(targetDir, ".github", file) : join(destDir, file);
|
|
78
|
+
if (!await fileExists(destFile)) await copyFile(join(srcDir, file), destFile);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region cli/utils/templates.ts
|
|
83
|
+
async function copyTemplate(templateDir, targetDir, vars) {
|
|
84
|
+
const entries = await readdir(templateDir, { withFileTypes: true });
|
|
85
|
+
for (const entry of entries) {
|
|
86
|
+
const src = join(templateDir, entry.name);
|
|
87
|
+
const dest = join(targetDir, entry.name);
|
|
88
|
+
if (entry.isDirectory()) {
|
|
89
|
+
await mkdir(dest, { recursive: true });
|
|
90
|
+
await copyTemplate(src, dest, vars);
|
|
91
|
+
} else {
|
|
92
|
+
let content = await readFile(src, "utf-8");
|
|
93
|
+
for (const [key, value] of Object.entries(vars)) content = content.replaceAll(`{{${key}}}`, value);
|
|
94
|
+
await writeFile(dest, content);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region cli/commands/bootstrap.ts
|
|
100
|
+
const execAsync = promisify(exec);
|
|
101
|
+
const DEV_DEPENDENCIES$1 = {
|
|
102
|
+
"@biomejs/biome": "^2.4.8",
|
|
103
|
+
bonvoy: "^0.13.1",
|
|
104
|
+
"@commitlint/cli": "^20.5.0",
|
|
105
|
+
"@commitlint/config-conventional": "^20.5.0",
|
|
106
|
+
"@tsconfig/node22": "^22.0.5",
|
|
107
|
+
"@types/node": "^25.5.0",
|
|
108
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
109
|
+
concurrently: "^9.2.1",
|
|
110
|
+
lefthook: "^2.1.4",
|
|
111
|
+
"lockfile-lint": "^5.0.0",
|
|
112
|
+
"ls-engines": "^0.10.0",
|
|
113
|
+
"npm-package-json-lint": "^9.1.0",
|
|
114
|
+
rimraf: "^6.1.3",
|
|
115
|
+
"sort-package-json": "^3.6.1",
|
|
116
|
+
tsdown: "^0.21.4",
|
|
117
|
+
typescript: "^5.9.3",
|
|
118
|
+
vitest: "^4.1.0"
|
|
119
|
+
};
|
|
120
|
+
const bootstrap = new Command().name("bootstrap").description("Bootstrap a new project with standard configuration").argument("[name]", "Package name", "@zweer/new-package").option("-t, --type <type>", "Project type: monorepo or single", "single").action(async (name, options) => {
|
|
121
|
+
const scope = name.includes("/") ? name.split("/")[0] : "";
|
|
122
|
+
const repoName = name.includes("/") ? name.split("/")[1] : name;
|
|
123
|
+
const templateDir = join(paths.root, "templates", options.type);
|
|
124
|
+
const vars = {
|
|
125
|
+
name,
|
|
126
|
+
scope,
|
|
127
|
+
description: "",
|
|
128
|
+
author: "Zweer <n.olivieriachille@gmail.com>",
|
|
129
|
+
homepage: `https://github.com/Zweer/${repoName}#readme`,
|
|
130
|
+
bugs: `https://github.com/Zweer/${repoName}/issues`,
|
|
131
|
+
repository: `git+https://github.com/Zweer/${repoName}.git`
|
|
132
|
+
};
|
|
133
|
+
const cwd = process.cwd();
|
|
134
|
+
await copyTemplate(templateDir, cwd, vars);
|
|
135
|
+
const pkgPath = join(cwd, "package.json");
|
|
136
|
+
const pkg = JSON.parse(await readFile(pkgPath, "utf-8"));
|
|
137
|
+
pkg.devDependencies = DEV_DEPENDENCIES$1;
|
|
138
|
+
pkg.homepage = vars.homepage;
|
|
139
|
+
pkg.bugs = { url: vars.bugs };
|
|
140
|
+
pkg.repository = {
|
|
141
|
+
type: "git",
|
|
142
|
+
url: vars.repository
|
|
143
|
+
};
|
|
144
|
+
await writeFile(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
145
|
+
for (const file of CONFIG_FILES) await copyConfig(file, cwd);
|
|
146
|
+
await copyWorkflows("base", cwd);
|
|
147
|
+
await writeFile(join(cwd, ".gitignore"), "dist/\nnode_modules/\ncoverage/\n*.lcov\n*.tsbuildinfo\n*.log\n.env\n.env.*\n!.env.example\n");
|
|
148
|
+
console.log("Installing dependencies...");
|
|
149
|
+
await execAsync("npm install");
|
|
150
|
+
console.log("Initializing git...");
|
|
151
|
+
await execAsync("git init && git add . && git commit -m \"chore: initial commit\"");
|
|
152
|
+
console.log(`\n✓ Project bootstrapped! (${options.type})`);
|
|
153
|
+
console.log("\nNext: run `dev init-kiro` to set up AI-assisted development.");
|
|
154
|
+
});
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region cli/commands/init-kiro.ts
|
|
157
|
+
const initKiro = new Command().name("init-kiro").description("Install the zweer-setup agent globally for Kiro-powered project configuration").action(async () => {
|
|
158
|
+
const kiroDir = join(homedir(), ".kiro");
|
|
159
|
+
await mkdir(join(kiroDir, "agents"), { recursive: true });
|
|
160
|
+
await cp(join(paths.kiro, "agents/zweer-setup.json"), join(kiroDir, "agents/zweer-setup.json"));
|
|
161
|
+
await mkdir(join(kiroDir, "prompts"), { recursive: true });
|
|
162
|
+
await cp(join(paths.kiro, "prompts/zweer-setup.md"), join(kiroDir, "prompts/zweer-setup.md"));
|
|
163
|
+
const skillsDest = join(kiroDir, "skills/zweer-dev");
|
|
164
|
+
await cp(join(paths.kiro, "skills"), skillsDest, { recursive: true });
|
|
165
|
+
console.log("✓ zweer-setup agent installed globally");
|
|
166
|
+
console.log(`\n Agent: ${join(kiroDir, "agents/zweer-setup.json")}`);
|
|
167
|
+
console.log(` Prompt: ${join(kiroDir, "prompts/zweer-setup.md")}`);
|
|
168
|
+
console.log(` Skills: ${skillsDest}/`);
|
|
169
|
+
console.log("\nTo configure this project:");
|
|
170
|
+
console.log(" 1. Run: kiro-cli chat");
|
|
171
|
+
console.log(" 2. Use: /agent swap zweer-setup");
|
|
172
|
+
});
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region cli/commands/setup.ts
|
|
175
|
+
const DEV_DEPENDENCIES = {
|
|
176
|
+
"@biomejs/biome": "^2.4.8",
|
|
177
|
+
bonvoy: "^0.13.1",
|
|
178
|
+
"@commitlint/cli": "^20.5.0",
|
|
179
|
+
"@commitlint/config-conventional": "^20.5.0",
|
|
180
|
+
"@tsconfig/node22": "^22.0.5",
|
|
181
|
+
"@types/node": "^25.5.0",
|
|
182
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
183
|
+
concurrently: "^9.2.1",
|
|
184
|
+
lefthook: "^2.1.4",
|
|
185
|
+
"lockfile-lint": "^5.0.0",
|
|
186
|
+
"ls-engines": "^0.10.0",
|
|
187
|
+
"npm-package-json-lint": "^9.1.0",
|
|
188
|
+
rimraf: "^6.1.3",
|
|
189
|
+
"sort-package-json": "^3.6.1",
|
|
190
|
+
tsdown: "^0.21.4",
|
|
191
|
+
typescript: "^5.9.3",
|
|
192
|
+
vitest: "^4.1.0"
|
|
193
|
+
};
|
|
194
|
+
const SCRIPTS = {
|
|
195
|
+
build: "tsdown",
|
|
196
|
+
clean: "rimraf dist",
|
|
197
|
+
lint: "concurrently npm:lint:* --prefixColors auto",
|
|
198
|
+
"lint:engines": "ls-engines",
|
|
199
|
+
"lint:format": "biome check --write",
|
|
200
|
+
"lint:lockfile": "lockfile-lint",
|
|
201
|
+
"lint:package": "npmPkgJsonLint .",
|
|
202
|
+
"lint:sort_package": "sort-package-json \"package.json\"",
|
|
203
|
+
"lint:typecheck": "tsc --noEmit",
|
|
204
|
+
prepare: "lefthook install",
|
|
205
|
+
test: "vitest run",
|
|
206
|
+
"test:coverage": "vitest run --coverage"
|
|
207
|
+
};
|
|
208
|
+
const setup = new Command().name("setup").description("Add standard configuration to an existing project").option("-y, --yes", "Skip prompts and add all configurations").action(async () => {
|
|
209
|
+
const cwd = process.cwd();
|
|
210
|
+
if (!await fileExists("package.json")) {
|
|
211
|
+
console.error("package.json not found. Run this in a project directory.");
|
|
212
|
+
process.exit(1);
|
|
213
|
+
}
|
|
214
|
+
for (const file of CONFIG_FILES) {
|
|
215
|
+
const copied = await copyConfig(file, cwd);
|
|
216
|
+
console.log(copied ? ` ✓ ${file.dest}` : ` · ${file.dest} (exists)`);
|
|
217
|
+
}
|
|
218
|
+
const pkg = JSON.parse(await readFile("package.json", "utf-8"));
|
|
219
|
+
pkg.devDependencies = {
|
|
220
|
+
...pkg.devDependencies,
|
|
221
|
+
...DEV_DEPENDENCIES
|
|
222
|
+
};
|
|
223
|
+
pkg.scripts = {
|
|
224
|
+
...pkg.scripts,
|
|
225
|
+
...SCRIPTS
|
|
226
|
+
};
|
|
227
|
+
if (!pkg.engines) pkg.engines = { node: ">= 22" };
|
|
228
|
+
await writeFile("package.json", `${JSON.stringify(pkg, null, 2)}\n`);
|
|
229
|
+
console.log(" ✓ package.json (deps + scripts merged)");
|
|
230
|
+
await copyWorkflows("base", cwd);
|
|
231
|
+
console.log(" ✓ .github/workflows/ (base)");
|
|
232
|
+
console.log("\n✓ Setup complete!");
|
|
233
|
+
console.log("\nNext: run `dev init-kiro` to set up AI-assisted development.");
|
|
234
|
+
});
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region cli/index.ts
|
|
237
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
238
|
+
const pkg = JSON.parse(readFileSync(resolve(__dirname, "..", "package.json"), "utf-8"));
|
|
239
|
+
const program = new Command().name(pkg.name).description(pkg.description).version(pkg.version);
|
|
240
|
+
program.addCommand(bootstrap);
|
|
241
|
+
program.addCommand(setup);
|
|
242
|
+
program.addCommand(initKiro);
|
|
243
|
+
program.parse();
|
|
244
|
+
//#endregion
|
|
245
|
+
export {};
|
|
246
|
+
|
|
247
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["__dirname","DEV_DEPENDENCIES"],"sources":["../cli/utils/paths.ts","../cli/utils/configs.ts","../cli/utils/templates.ts","../cli/commands/bootstrap.ts","../cli/commands/init-kiro.ts","../cli/commands/setup.ts","../cli/index.ts"],"sourcesContent":["import { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __filename: string = fileURLToPath(import.meta.url);\nconst __dirname: string = dirname(__filename);\n\nexport const paths: { root: string; configs: string; kiro: string; workflows: string } = {\n root: join(__dirname, '../..'),\n configs: join(__dirname, '../../configs'),\n kiro: join(__dirname, '../../kiro'),\n workflows: join(__dirname, '../../workflows'),\n};\n","import { access, copyFile, mkdir, readdir, readFile, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nimport { paths } from './paths.js';\n\nexport async function fileExists(path: string): Promise<boolean> {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\n\nexport interface ConfigFile {\n src: string;\n dest: string;\n}\n\nexport const CONFIG_FILES: ConfigFile[] = [\n { src: '_biome.json', dest: 'biome.json' },\n { src: 'editorconfig', dest: '.editorconfig' },\n { src: 'commitlint.config.ts', dest: 'commitlint.config.ts' },\n { src: 'lefthook.yml', dest: 'lefthook.yml' },\n { src: 'lockfile-lintrc.json', dest: '.lockfile-lintrc.json' },\n { src: 'npmpackagejsonlintrc.json', dest: '.npmpackagejsonlintrc.json' },\n { src: 'tsconfig.json', dest: 'tsconfig.json' },\n { src: 'tsdown.config.ts', dest: 'tsdown.config.ts' },\n { src: 'vitest.config.ts', dest: 'vitest.config.ts' },\n];\n\nexport async function copyConfig(file: ConfigFile, targetDir: string): Promise<boolean> {\n const dest = join(targetDir, file.dest);\n if (await fileExists(dest)) return false;\n await copyFile(join(paths.configs, file.src), dest);\n return true;\n}\n\nexport async function copyWorkflows(\n tier: 'base' | 'library' | 'docs',\n targetDir: string,\n): Promise<void> {\n const srcDir = join(paths.workflows, tier);\n const destDir = join(targetDir, '.github/workflows');\n await mkdir(destDir, { recursive: true });\n\n for (const file of await readdir(srcDir)) {\n // dependabot.yml goes to .github/, not .github/workflows/\n const destFile =\n file === 'dependabot.yml' ? join(targetDir, '.github', file) : join(destDir, file);\n if (!(await fileExists(destFile))) {\n await copyFile(join(srcDir, file), destFile);\n }\n }\n}\n\nexport async function mergePackageJson(\n targetDir: string,\n overrides: { scripts?: Record<string, string>; devDependencies?: Record<string, string> },\n): Promise<void> {\n const pkgPath = join(targetDir, 'package.json');\n const pkg = JSON.parse(await readFile(pkgPath, 'utf-8'));\n\n if (overrides.scripts) {\n pkg.scripts = { ...pkg.scripts, ...overrides.scripts };\n }\n if (overrides.devDependencies) {\n pkg.devDependencies = { ...pkg.devDependencies, ...overrides.devDependencies };\n }\n\n await writeFile(pkgPath, `${JSON.stringify(pkg, null, 2)}\\n`);\n}\n","import { mkdir, readdir, readFile, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nexport async function copyTemplate(\n templateDir: string,\n targetDir: string,\n vars: Record<string, string>,\n): Promise<void> {\n const entries = await readdir(templateDir, { withFileTypes: true });\n\n for (const entry of entries) {\n const src = join(templateDir, entry.name);\n const dest = join(targetDir, entry.name);\n\n if (entry.isDirectory()) {\n await mkdir(dest, { recursive: true });\n await copyTemplate(src, dest, vars);\n } else {\n let content = await readFile(src, 'utf-8');\n for (const [key, value] of Object.entries(vars)) {\n content = content.replaceAll(`{{${key}}}`, value);\n }\n await writeFile(dest, content);\n }\n }\n}\n","import { exec } from 'node:child_process';\nimport { readFile, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { promisify } from 'node:util';\n\nimport { Command } from '@commander-js/extra-typings';\n\nimport { CONFIG_FILES, copyConfig, copyWorkflows } from '../utils/configs.js';\nimport { paths } from '../utils/paths.js';\nimport { copyTemplate } from '../utils/templates.js';\n\nconst execAsync = promisify(exec);\n\nconst DEV_DEPENDENCIES: Record<string, string> = {\n '@biomejs/biome': '^2.4.8',\n bonvoy: '^0.13.1',\n '@commitlint/cli': '^20.5.0',\n '@commitlint/config-conventional': '^20.5.0',\n '@tsconfig/node22': '^22.0.5',\n '@types/node': '^25.5.0',\n '@vitest/coverage-v8': '^4.1.0',\n concurrently: '^9.2.1',\n lefthook: '^2.1.4',\n 'lockfile-lint': '^5.0.0',\n 'ls-engines': '^0.10.0',\n 'npm-package-json-lint': '^9.1.0',\n rimraf: '^6.1.3',\n 'sort-package-json': '^3.6.1',\n tsdown: '^0.21.4',\n typescript: '^5.9.3',\n vitest: '^4.1.0',\n};\n\nexport const bootstrap = new Command()\n .name('bootstrap')\n .description('Bootstrap a new project with standard configuration')\n .argument('[name]', 'Package name', '@zweer/new-package')\n .option('-t, --type <type>', 'Project type: monorepo or single', 'single')\n .action(async (name, options) => {\n const scope = name.includes('/') ? name.split('/')[0] : '';\n const repoName = name.includes('/') ? name.split('/')[1] : name;\n const templateDir = join(paths.root, 'templates', options.type);\n\n const vars: Record<string, string> = {\n name,\n scope,\n description: '',\n author: 'Zweer <n.olivieriachille@gmail.com>',\n homepage: `https://github.com/Zweer/${repoName}#readme`,\n bugs: `https://github.com/Zweer/${repoName}/issues`,\n repository: `git+https://github.com/Zweer/${repoName}.git`,\n };\n\n // Copy template with variable substitution\n const cwd = process.cwd();\n await copyTemplate(templateDir, cwd, vars);\n\n // Inject devDependencies into the generated package.json\n const pkgPath = join(cwd, 'package.json');\n const pkg = JSON.parse(await readFile(pkgPath, 'utf-8'));\n pkg.devDependencies = DEV_DEPENDENCIES;\n pkg.homepage = vars.homepage;\n pkg.bugs = { url: vars.bugs };\n pkg.repository = { type: 'git', url: vars.repository };\n await writeFile(pkgPath, `${JSON.stringify(pkg, null, 2)}\\n`);\n\n // Copy golden configs (biome, editorconfig, lefthook, etc.)\n for (const file of CONFIG_FILES) {\n await copyConfig(file, cwd);\n }\n\n // Copy base workflows\n await copyWorkflows('base', cwd);\n\n // Create .gitignore\n await writeFile(\n join(cwd, '.gitignore'),\n 'dist/\\nnode_modules/\\ncoverage/\\n*.lcov\\n*.tsbuildinfo\\n*.log\\n.env\\n.env.*\\n!.env.example\\n',\n );\n\n // Install deps + init git\n console.log('Installing dependencies...');\n await execAsync('npm install');\n\n console.log('Initializing git...');\n await execAsync('git init && git add . && git commit -m \"chore: initial commit\"');\n\n console.log(`\\n✓ Project bootstrapped! (${options.type})`);\n console.log('\\nNext: run `dev init-kiro` to set up AI-assisted development.');\n });\n","import { cp, mkdir } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\n\nimport { Command } from '@commander-js/extra-typings';\n\nimport { paths } from '../utils/paths.js';\n\nexport const initKiro = new Command()\n .name('init-kiro')\n .description('Install the zweer-setup agent globally for Kiro-powered project configuration')\n .action(async () => {\n const home = homedir();\n const kiroDir = join(home, '.kiro');\n\n // Copy agent\n await mkdir(join(kiroDir, 'agents'), { recursive: true });\n await cp(join(paths.kiro, 'agents/zweer-setup.json'), join(kiroDir, 'agents/zweer-setup.json'));\n\n // Copy prompt\n await mkdir(join(kiroDir, 'prompts'), { recursive: true });\n await cp(join(paths.kiro, 'prompts/zweer-setup.md'), join(kiroDir, 'prompts/zweer-setup.md'));\n\n // Copy skills\n const skillsDest = join(kiroDir, 'skills/zweer-dev');\n await cp(join(paths.kiro, 'skills'), skillsDest, { recursive: true });\n\n console.log('✓ zweer-setup agent installed globally');\n console.log(`\\n Agent: ${join(kiroDir, 'agents/zweer-setup.json')}`);\n console.log(` Prompt: ${join(kiroDir, 'prompts/zweer-setup.md')}`);\n console.log(` Skills: ${skillsDest}/`);\n console.log('\\nTo configure this project:');\n console.log(' 1. Run: kiro-cli chat');\n console.log(' 2. Use: /agent swap zweer-setup');\n });\n","import { readFile, writeFile } from 'node:fs/promises';\n\nimport { Command } from '@commander-js/extra-typings';\n\nimport { CONFIG_FILES, copyConfig, copyWorkflows, fileExists } from '../utils/configs.js';\n\nconst DEV_DEPENDENCIES: Record<string, string> = {\n '@biomejs/biome': '^2.4.8',\n bonvoy: '^0.13.1',\n '@commitlint/cli': '^20.5.0',\n '@commitlint/config-conventional': '^20.5.0',\n '@tsconfig/node22': '^22.0.5',\n '@types/node': '^25.5.0',\n '@vitest/coverage-v8': '^4.1.0',\n concurrently: '^9.2.1',\n lefthook: '^2.1.4',\n 'lockfile-lint': '^5.0.0',\n 'ls-engines': '^0.10.0',\n 'npm-package-json-lint': '^9.1.0',\n rimraf: '^6.1.3',\n 'sort-package-json': '^3.6.1',\n tsdown: '^0.21.4',\n typescript: '^5.9.3',\n vitest: '^4.1.0',\n};\n\nconst SCRIPTS: Record<string, string> = {\n build: 'tsdown',\n clean: 'rimraf dist',\n lint: 'concurrently npm:lint:* --prefixColors auto',\n 'lint:engines': 'ls-engines',\n 'lint:format': 'biome check --write',\n 'lint:lockfile': 'lockfile-lint',\n 'lint:package': 'npmPkgJsonLint .',\n 'lint:sort_package': 'sort-package-json \"package.json\"',\n 'lint:typecheck': 'tsc --noEmit',\n prepare: 'lefthook install',\n test: 'vitest run',\n 'test:coverage': 'vitest run --coverage',\n};\n\nexport const setup = new Command()\n .name('setup')\n .description('Add standard configuration to an existing project')\n .option('-y, --yes', 'Skip prompts and add all configurations')\n .action(async () => {\n const cwd = process.cwd();\n\n if (!(await fileExists('package.json'))) {\n console.error('package.json not found. Run this in a project directory.');\n process.exit(1);\n }\n\n // Copy config files (skip existing)\n for (const file of CONFIG_FILES) {\n const copied = await copyConfig(file, cwd);\n console.log(copied ? ` ✓ ${file.dest}` : ` · ${file.dest} (exists)`);\n }\n\n // Merge deps and scripts into package.json\n const pkg = JSON.parse(await readFile('package.json', 'utf-8'));\n pkg.devDependencies = { ...pkg.devDependencies, ...DEV_DEPENDENCIES };\n pkg.scripts = { ...pkg.scripts, ...SCRIPTS };\n if (!pkg.engines) pkg.engines = { node: '>= 22' };\n await writeFile('package.json', `${JSON.stringify(pkg, null, 2)}\\n`);\n console.log(' ✓ package.json (deps + scripts merged)');\n\n // Copy base workflows\n await copyWorkflows('base', cwd);\n console.log(' ✓ .github/workflows/ (base)');\n\n console.log('\\n✓ Setup complete!');\n console.log('\\nNext: run `dev init-kiro` to set up AI-assisted development.');\n });\n","#!/usr/bin/env node\n\nimport { readFileSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport { Command } from '@commander-js/extra-typings';\n\nimport { bootstrap } from './commands/bootstrap.js';\nimport { initKiro } from './commands/init-kiro.js';\nimport { setup } from './commands/setup.js';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst pkg = JSON.parse(readFileSync(resolve(__dirname, '..', 'package.json'), 'utf-8')) as {\n name: string;\n description: string;\n version: string;\n};\n\nconst program = new Command().name(pkg.name).description(pkg.description).version(pkg.version);\n\nprogram.addCommand(bootstrap);\nprogram.addCommand(setup);\nprogram.addCommand(initKiro);\n\nprogram.parse();\n"],"mappings":";;;;;;;;;;AAIA,MAAMA,cAAoB,QADC,cAAc,OAAO,KAAK,IAAI,CACZ;AAE7C,MAAa,QAA4E;CACvF,MAAM,KAAKA,aAAW,QAAQ;CAC9B,SAAS,KAAKA,aAAW,gBAAgB;CACzC,MAAM,KAAKA,aAAW,aAAa;CACnC,WAAW,KAAKA,aAAW,kBAAkB;CAC9C;;;ACND,eAAsB,WAAW,MAAgC;AAC/D,KAAI;AACF,QAAM,OAAO,KAAK;AAClB,SAAO;SACD;AACN,SAAO;;;AASX,MAAa,eAA6B;CACxC;EAAE,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AAI;AAChC,SAAQ,IAAI,gCAAgC;AAE5C,SAAQ,IAAI,sBAAsB;AAClC,SAAQ,IAAI,iEAAiE;EAC7E;;;AC7DJ,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AACzD,MAAM,MAAM,KAAK,MAAM,aAAa,QAAQ,WAAW,MAAM,eAAe,EAAE,QAAQ,CAAC;AAMvF,MAAM,UAAU,IAAI,SAAS,CAAC,KAAK,IAAI,KAAK,CAAC,YAAY,IAAI,YAAY,CAAC,QAAQ,IAAI,QAAQ;AAE9F,QAAQ,WAAW,UAAU;AAC7B,QAAQ,WAAW,MAAM;AACzB,QAAQ,WAAW,SAAS;AAE5B,QAAQ,OAAO"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zweer-setup",
|
|
3
|
+
"description": "Agent that analyzes a project and generates optimal .kiro/ configuration (steering, agent, prompt, skills)",
|
|
4
|
+
"prompt": "file://../prompts/zweer-setup.md",
|
|
5
|
+
"resources": ["skill://.kiro/skills/**/SKILL.md"],
|
|
6
|
+
"tools": [
|
|
7
|
+
"read",
|
|
8
|
+
"write",
|
|
9
|
+
"shell",
|
|
10
|
+
"grep",
|
|
11
|
+
"glob",
|
|
12
|
+
"web_search",
|
|
13
|
+
"web_fetch",
|
|
14
|
+
"introspect",
|
|
15
|
+
"thinking",
|
|
16
|
+
"code"
|
|
17
|
+
],
|
|
18
|
+
"allowedTools": [
|
|
19
|
+
"read",
|
|
20
|
+
"shell",
|
|
21
|
+
"grep",
|
|
22
|
+
"glob",
|
|
23
|
+
"web_search",
|
|
24
|
+
"web_fetch",
|
|
25
|
+
"introspect",
|
|
26
|
+
"thinking",
|
|
27
|
+
"code"
|
|
28
|
+
],
|
|
29
|
+
"toolsSettings": {
|
|
30
|
+
"write": {
|
|
31
|
+
"allowedPaths": [".kiro/**"]
|
|
32
|
+
},
|
|
33
|
+
"shell": {
|
|
34
|
+
"autoAllowReadonly": true,
|
|
35
|
+
"deniedCommands": [".*git commit.*", ".*git push.*", ".*git tag .*", ".*npm publish.*"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# zweer-setup — Kiro Configuration Agent
|
|
2
|
+
|
|
3
|
+
You are the **zweer-setup agent**. Your job is to analyze a project and generate the optimal `.kiro/` configuration for it.
|
|
4
|
+
|
|
5
|
+
## What You Do
|
|
6
|
+
|
|
7
|
+
1. **Analyze the project**: Read `package.json`, directory structure, README, existing configs
|
|
8
|
+
2. **Ask clarifying questions**: Project type, deploy target, special needs
|
|
9
|
+
3. **Generate `.kiro/` config**: Agent, prompt, steering files, skills — all tailored to the project
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
### Step 1: Analyze
|
|
14
|
+
Read these files (if they exist):
|
|
15
|
+
- `package.json` (name, scripts, deps, workspaces)
|
|
16
|
+
- `README.md` (project description, architecture)
|
|
17
|
+
- `tsconfig.json`, `biome.json`, `vitest.config.ts` (tooling)
|
|
18
|
+
- Directory structure (monorepo? apps? packages?)
|
|
19
|
+
|
|
20
|
+
### Step 2: Classify
|
|
21
|
+
Determine the project type:
|
|
22
|
+
- **Monorepo library** (npm packages, like bonvoy/FlowRAG)
|
|
23
|
+
- **Web app** (SvelteKit/Next.js/Nuxt, like drop-coop)
|
|
24
|
+
- **CLI tool** (like @zweer/dev itself)
|
|
25
|
+
- **Infrastructure** (CDK/Terraform)
|
|
26
|
+
- **Other** (ask the user)
|
|
27
|
+
|
|
28
|
+
### Step 3: Generate
|
|
29
|
+
Create these files under `.kiro/`:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
.kiro/
|
|
33
|
+
├── agents/
|
|
34
|
+
│ └── dev.json # Agent config
|
|
35
|
+
├── prompts/
|
|
36
|
+
│ └── dev.md # Agent prompt
|
|
37
|
+
├── steering/
|
|
38
|
+
│ ├── code-style.md # Always
|
|
39
|
+
│ ├── build-tooling.md # Always
|
|
40
|
+
│ ├── testing.md # Always
|
|
41
|
+
│ ├── interaction.md # Always
|
|
42
|
+
│ └── commit-conventions.md # Always
|
|
43
|
+
└── skills/
|
|
44
|
+
└── (project-specific)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Use the templates in your skills' `references/` folders. Adapt them to the specific project.
|
|
48
|
+
|
|
49
|
+
## Rules
|
|
50
|
+
|
|
51
|
+
- **NEVER commit or push** — the developer handles git
|
|
52
|
+
- **Ask before generating** — confirm project type and any assumptions
|
|
53
|
+
- **Use real project details** — don't use placeholder names
|
|
54
|
+
- **Keep steering files under 200 lines** — split if needed
|
|
55
|
+
- **Write paths** are restricted to `.kiro/**` only
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-template
|
|
3
|
+
description: Generate .kiro/agents/dev.json for a project. Use when setting up a new project's Kiro agent configuration.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Template
|
|
7
|
+
|
|
8
|
+
Generate a `.kiro/agents/dev.json` file tailored to the project.
|
|
9
|
+
|
|
10
|
+
## Rules
|
|
11
|
+
|
|
12
|
+
1. Always deny `git commit`, `git push`, `git tag`, `npm publish` in shell
|
|
13
|
+
2. Set `autoAllowReadonly: true` on shell
|
|
14
|
+
3. `allowedTools` should include everything EXCEPT `write` (write needs approval)
|
|
15
|
+
4. `write.allowedPaths` should be project-specific (source dirs, configs, .kiro)
|
|
16
|
+
5. Prompt should reference `file://../prompts/dev.md`
|
|
17
|
+
6. Resources should include README, steering, and skills
|
|
18
|
+
|
|
19
|
+
## References
|
|
20
|
+
- Review `references/base.json` for the common agent structure
|
|
21
|
+
- Review `references/example-monorepo-library.json` for npm library projects
|
|
22
|
+
- Review `references/example-webapp-vercel.json` for web app projects
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dev",
|
|
3
|
+
"description": "Development agent for __PROJECT_NAME__",
|
|
4
|
+
"prompt": "file://../prompts/dev.md",
|
|
5
|
+
"resources": ["file://README.md", "file://.kiro/specs/**/*.md", "file://.kiro/steering/**/*.md"],
|
|
6
|
+
"tools": [
|
|
7
|
+
"read",
|
|
8
|
+
"write",
|
|
9
|
+
"shell",
|
|
10
|
+
"grep",
|
|
11
|
+
"glob",
|
|
12
|
+
"web_search",
|
|
13
|
+
"web_fetch",
|
|
14
|
+
"introspect",
|
|
15
|
+
"thinking",
|
|
16
|
+
"code"
|
|
17
|
+
],
|
|
18
|
+
"allowedTools": [
|
|
19
|
+
"read",
|
|
20
|
+
"shell",
|
|
21
|
+
"grep",
|
|
22
|
+
"glob",
|
|
23
|
+
"web_search",
|
|
24
|
+
"web_fetch",
|
|
25
|
+
"introspect",
|
|
26
|
+
"thinking",
|
|
27
|
+
"code"
|
|
28
|
+
],
|
|
29
|
+
"toolsSettings": {
|
|
30
|
+
"write": {
|
|
31
|
+
"allowedPaths": ["__PROJECT_SPECIFIC__"]
|
|
32
|
+
},
|
|
33
|
+
"shell": {
|
|
34
|
+
"autoAllowReadonly": true,
|
|
35
|
+
"deniedCommands": [".*git commit.*", ".*git push.*", ".*git tag .*", ".*npm publish.*"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dev",
|
|
3
|
+
"description": "Agent for __NAME__ - TypeScript library with npm packages",
|
|
4
|
+
"prompt": "file://../prompts/dev.md",
|
|
5
|
+
"resources": [
|
|
6
|
+
"file://README.md",
|
|
7
|
+
"file://.kiro/specs/**/*.md",
|
|
8
|
+
"file://.kiro/steering/**/*.md",
|
|
9
|
+
"file://docs/**/*.md"
|
|
10
|
+
],
|
|
11
|
+
"tools": [
|
|
12
|
+
"read",
|
|
13
|
+
"write",
|
|
14
|
+
"shell",
|
|
15
|
+
"grep",
|
|
16
|
+
"glob",
|
|
17
|
+
"web_search",
|
|
18
|
+
"web_fetch",
|
|
19
|
+
"introspect",
|
|
20
|
+
"thinking",
|
|
21
|
+
"code"
|
|
22
|
+
],
|
|
23
|
+
"allowedTools": [
|
|
24
|
+
"read",
|
|
25
|
+
"shell",
|
|
26
|
+
"grep",
|
|
27
|
+
"glob",
|
|
28
|
+
"web_search",
|
|
29
|
+
"web_fetch",
|
|
30
|
+
"introspect",
|
|
31
|
+
"thinking",
|
|
32
|
+
"code"
|
|
33
|
+
],
|
|
34
|
+
"toolsSettings": {
|
|
35
|
+
"write": {
|
|
36
|
+
"allowedPaths": [
|
|
37
|
+
".kiro/**",
|
|
38
|
+
"packages/**",
|
|
39
|
+
"docs/**",
|
|
40
|
+
"scripts/**",
|
|
41
|
+
".github/**",
|
|
42
|
+
"README.md",
|
|
43
|
+
"CHANGELOG.md",
|
|
44
|
+
"package.json",
|
|
45
|
+
"package-lock.json",
|
|
46
|
+
"tsconfig.json",
|
|
47
|
+
"tsdown.config.ts",
|
|
48
|
+
"vitest.config.ts",
|
|
49
|
+
"biome.json",
|
|
50
|
+
".editorconfig",
|
|
51
|
+
".gitignore",
|
|
52
|
+
".npmpackagejsonlintrc.json"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"shell": {
|
|
56
|
+
"autoAllowReadonly": true,
|
|
57
|
+
"deniedCommands": [".*git commit.*", ".*git push.*", ".*git tag .*", ".*npm publish.*"]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dev",
|
|
3
|
+
"description": "Agent for __NAME__ - Web application deployed on Vercel",
|
|
4
|
+
"prompt": "file://../prompts/dev.md",
|
|
5
|
+
"resources": ["file://README.md", "file://.kiro/specs/**/*.md", "file://.kiro/steering/**/*.md"],
|
|
6
|
+
"tools": [
|
|
7
|
+
"read",
|
|
8
|
+
"write",
|
|
9
|
+
"shell",
|
|
10
|
+
"grep",
|
|
11
|
+
"glob",
|
|
12
|
+
"web_search",
|
|
13
|
+
"web_fetch",
|
|
14
|
+
"introspect",
|
|
15
|
+
"thinking",
|
|
16
|
+
"code"
|
|
17
|
+
],
|
|
18
|
+
"allowedTools": [
|
|
19
|
+
"read",
|
|
20
|
+
"shell",
|
|
21
|
+
"grep",
|
|
22
|
+
"glob",
|
|
23
|
+
"web_search",
|
|
24
|
+
"web_fetch",
|
|
25
|
+
"introspect",
|
|
26
|
+
"thinking",
|
|
27
|
+
"code"
|
|
28
|
+
],
|
|
29
|
+
"toolsSettings": {
|
|
30
|
+
"write": {
|
|
31
|
+
"allowedPaths": [
|
|
32
|
+
".kiro/**",
|
|
33
|
+
".github/**",
|
|
34
|
+
"packages/**",
|
|
35
|
+
"docs/**",
|
|
36
|
+
"README.md",
|
|
37
|
+
"CHANGELOG.md",
|
|
38
|
+
"package.json",
|
|
39
|
+
"package-lock.json",
|
|
40
|
+
"tsconfig.json",
|
|
41
|
+
"vitest.config.ts",
|
|
42
|
+
"biome.json",
|
|
43
|
+
".editorconfig",
|
|
44
|
+
".gitignore",
|
|
45
|
+
"docker-compose.yml",
|
|
46
|
+
"Dockerfile"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"shell": {
|
|
50
|
+
"autoAllowReadonly": true,
|
|
51
|
+
"deniedCommands": [".*git commit.*", ".*git push.*", ".*git tag .*", ".*npm publish.*"]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prompt-template
|
|
3
|
+
description: Generate .kiro/prompts/dev.md for a project. Use when creating the agent's system prompt.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Prompt Template
|
|
7
|
+
|
|
8
|
+
Generate a `.kiro/prompts/dev.md` file tailored to the project.
|
|
9
|
+
|
|
10
|
+
## Structure
|
|
11
|
+
|
|
12
|
+
Every prompt should have these sections:
|
|
13
|
+
1. **Title & Role** — "You are the __NAME__ Development Agent"
|
|
14
|
+
2. **Project Mission** — What the project does, in 2-3 sentences
|
|
15
|
+
3. **Project Knowledge** — Which specs/docs to always reference
|
|
16
|
+
4. **Architecture Overview** — Tech stack, structure, design principles
|
|
17
|
+
5. **Development Guidelines** — TypeScript style, testing, code quality
|
|
18
|
+
6. **Git Rules** — NEVER commit/push, suggest commit messages
|
|
19
|
+
7. **Communication Style** — Language, tone, focus
|
|
20
|
+
|
|
21
|
+
## References
|
|
22
|
+
- Review `references/example-library.md` for npm library prompts
|
|
23
|
+
- Review `references/example-webapp.md` for web app prompts
|