@batijs/cli 0.0.657 → 0.0.659
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/dist/boilerplates/@batijs/auth0/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/authjs/bati.config.mjs +2 -16
- package/dist/boilerplates/@batijs/aws/bati.config.mjs +1 -13
- package/dist/boilerplates/@batijs/better-auth/bati.config.mjs +2 -17
- package/dist/boilerplates/@batijs/biome/bati.config.mjs +2 -16
- package/dist/boilerplates/@batijs/cloudflare/bati.config.mjs +1 -15
- package/dist/boilerplates/@batijs/compiled/bati.config.mjs +1 -13
- package/dist/boilerplates/@batijs/d1/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/d1-kysely/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/d1-sqlite/bati.config.mjs +4 -18
- package/dist/boilerplates/@batijs/docker-compose/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/dokploy/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/drizzle/bati.config.mjs +1 -17
- package/dist/boilerplates/@batijs/edgeone/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/elysia/bati.config.mjs +2 -15
- package/dist/boilerplates/@batijs/eslint/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/express/bati.config.mjs +2 -15
- package/dist/boilerplates/@batijs/fastify/bati.config.mjs +2 -15
- package/dist/boilerplates/@batijs/google-analytics/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/hono/bati.config.mjs +2 -15
- package/dist/boilerplates/@batijs/kysely/bati.config.mjs +2 -16
- package/dist/boilerplates/@batijs/mantine/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/netlify/bati.config.mjs +4 -18
- package/dist/boilerplates/@batijs/oxlint/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/plausible.io/bati.config.mjs +4 -18
- package/dist/boilerplates/@batijs/pnpm/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/postgres/bati.config.mjs +1 -13
- package/dist/boilerplates/@batijs/prettier/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/prisma/bati.config.mjs +2 -20
- package/dist/boilerplates/@batijs/react/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/react-better-auth/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/react-sentry/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/sentry/bati.config.mjs +1 -14
- package/dist/boilerplates/@batijs/shadcn-ui/bati.config.mjs +4 -19
- package/dist/boilerplates/@batijs/shared/bati.config.mjs +1 -94
- package/dist/boilerplates/@batijs/shared-agents/bati.config.mjs +2 -7
- package/dist/boilerplates/@batijs/shared-agents/hooks/after.mjs +17 -7
- package/dist/boilerplates/@batijs/shared-agents/hooks/asset-boilerplates/shared-agents/compose.mjs +14 -35
- package/dist/boilerplates/@batijs/shared-agents/hooks/asset-packages/features/dist/{features-CStxEDu3.mjs → features-CGdfnf9U.mjs} +110 -84
- package/dist/boilerplates/@batijs/shared-agents/hooks/asset-packages/features/dist/index.mjs +5 -158
- package/dist/boilerplates/@batijs/shared-db/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shared-env/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shared-server/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/shared-todo/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/solid/bati.config.mjs +4 -18
- package/dist/boilerplates/@batijs/solid-better-auth/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/solid-sentry/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/sqlite/bati.config.mjs +1 -13
- package/dist/boilerplates/@batijs/storybook/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/tailwindcss/bati.config.mjs +2 -27
- package/dist/boilerplates/@batijs/telefunc/bati.config.mjs +4 -20
- package/dist/boilerplates/@batijs/trpc/bati.config.mjs +4 -19
- package/dist/boilerplates/@batijs/ts-rest/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/universal-deploy/bati.config.mjs +4 -21
- package/dist/boilerplates/@batijs/vercel/bati.config.mjs +1 -13
- package/dist/boilerplates/@batijs/vue/bati.config.mjs +2 -14
- package/dist/boilerplates/@batijs/vue-better-auth/bati.config.mjs +1 -1
- package/dist/boilerplates/@batijs/vue-sentry/bati.config.mjs +1 -1
- package/dist/index.js +2 -6
- package/package.json +5 -5
- package/dist/boilerplates/@batijs/shared-agents/hooks/asset-boilerplates/shared-agents/agents-md.mjs +0 -70
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
|
-
import { dirname, join } from "node:path";
|
|
1
|
+
import { CLAUDE_SKILLS_DIR, SKILLS_DIR } from "./asset-packages/features/dist/index.mjs";
|
|
2
|
+
import { composeSkills } from "./asset-boilerplates/shared-agents/compose.mjs";
|
|
3
|
+
import { cp, mkdir, symlink, writeFile } from "node:fs/promises";
|
|
4
|
+
import { dirname, join, relative } from "node:path";
|
|
5
5
|
//#region hooks/after.ts
|
|
6
|
-
async function onafter(cwd, meta
|
|
7
|
-
const
|
|
8
|
-
for (const { path, content } of agentFiles) {
|
|
6
|
+
async function onafter(cwd, meta) {
|
|
7
|
+
for (const { path, content } of composeSkills((flag) => meta.BATI.has(flag))) {
|
|
9
8
|
const dest = join(cwd, path);
|
|
10
9
|
await mkdir(dirname(dest), { recursive: true });
|
|
11
10
|
await writeFile(dest, content, "utf-8");
|
|
12
11
|
}
|
|
12
|
+
await mirrorSkillsForClaude(cwd);
|
|
13
|
+
}
|
|
14
|
+
async function mirrorSkillsForClaude(cwd) {
|
|
15
|
+
const source = join(cwd, SKILLS_DIR);
|
|
16
|
+
const target = join(cwd, CLAUDE_SKILLS_DIR);
|
|
17
|
+
await mkdir(dirname(target), { recursive: true });
|
|
18
|
+
try {
|
|
19
|
+
await symlink(relative(dirname(target), source), target, "dir");
|
|
20
|
+
} catch {
|
|
21
|
+
await cp(source, target, { recursive: true });
|
|
22
|
+
}
|
|
13
23
|
}
|
|
14
24
|
//#endregion
|
|
15
25
|
export { onafter as default };
|
package/dist/boilerplates/@batijs/shared-agents/hooks/asset-boilerplates/shared-agents/compose.mjs
CHANGED
|
@@ -1,44 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { features } from "../../asset-packages/features/dist/features-CGdfnf9U.mjs";
|
|
2
|
+
import { SKILLS_DIR } from "../../asset-packages/features/dist/index.mjs";
|
|
2
3
|
//#region compose.ts
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* One `SKILL.md` per in-stack feature that publishes an `llms.txt`, under {@link SKILLS_DIR}, sorted by
|
|
6
|
+
* flag (deterministic output). Each skill is a pointer to the live docs — no how-to is stored, so it never
|
|
7
|
+
* goes stale. Flags are unique, so names never collide. `readonly` features (e.g. Vike) are always in the
|
|
8
|
+
* stack, so their skill is emitted regardless of selection.
|
|
7
9
|
*/
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
for (const dir of resolveSkillDirs(selected)) for (const skill of sortedSkills) files.push({
|
|
14
|
-
path: `${dir}/${skill.name}/SKILL.md`,
|
|
15
|
-
content: renderSkillMd(skill)
|
|
16
|
-
});
|
|
17
|
-
for (const target of resolveInstructionFiles(selected)) files.push({
|
|
18
|
-
path: target.path,
|
|
19
|
-
content: target.import === null ? ensureTrailingNewline(agentsBody) : `${target.import}\n`
|
|
20
|
-
});
|
|
21
|
-
return files;
|
|
10
|
+
function composeSkills(isSelected) {
|
|
11
|
+
return features.filter((f) => Boolean(f.skill) && (f.readonly || isSelected(f.flag))).sort((a, b) => a.flag.localeCompare(b.flag)).map((f) => ({
|
|
12
|
+
path: `${SKILLS_DIR}/${f.flag}/SKILL.md`,
|
|
13
|
+
content: renderSkillMd(f.flag, f.label, f.skill)
|
|
14
|
+
}));
|
|
22
15
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const frontmatter = [`name: ${yamlString(skill.name)}`, `description: ${yamlString(skill.description)}`];
|
|
26
|
-
if (skill.allowedTools?.length) frontmatter.push(`allowed-tools: [${skill.allowedTools.map(yamlString).join(", ")}]`);
|
|
27
|
-
return `---\n${frontmatter.join("\n")}\n---\n\n${ensureTrailingNewline(skill.body)}`;
|
|
16
|
+
function renderSkillMd(flag, label, skill) {
|
|
17
|
+
return `---\n${`name: ${yamlString(flag)}\ndescription: ${yamlString(skill.description)}`}\n---\n\n${`Up-to-date ${label} documentation for this project. Read it before working with ${label}:\n\n${skill.llms}`}\n`;
|
|
28
18
|
}
|
|
29
|
-
function assertUniqueNames(skills) {
|
|
30
|
-
const seen = /* @__PURE__ */ new Set();
|
|
31
|
-
for (const { name } of skills) {
|
|
32
|
-
if (seen.has(name)) throw new Error(`Duplicate skill name '${name}' — skill names must be unique.`);
|
|
33
|
-
seen.add(name);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function ensureTrailingNewline(s) {
|
|
37
|
-
return s.endsWith("\n") ? s : `${s}\n`;
|
|
38
|
-
}
|
|
39
|
-
/** Double-quote and escape so the colons/brackets common in descriptions stay YAML-safe. */
|
|
40
19
|
function yamlString(s) {
|
|
41
20
|
return `"${s.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
|
|
42
21
|
}
|
|
43
22
|
//#endregion
|
|
44
|
-
export {
|
|
23
|
+
export { composeSkills };
|