@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.
Files changed (61) hide show
  1. package/dist/boilerplates/@batijs/auth0/bati.config.mjs +1 -1
  2. package/dist/boilerplates/@batijs/authjs/bati.config.mjs +2 -16
  3. package/dist/boilerplates/@batijs/aws/bati.config.mjs +1 -13
  4. package/dist/boilerplates/@batijs/better-auth/bati.config.mjs +2 -17
  5. package/dist/boilerplates/@batijs/biome/bati.config.mjs +2 -16
  6. package/dist/boilerplates/@batijs/cloudflare/bati.config.mjs +1 -15
  7. package/dist/boilerplates/@batijs/compiled/bati.config.mjs +1 -13
  8. package/dist/boilerplates/@batijs/d1/bati.config.mjs +1 -1
  9. package/dist/boilerplates/@batijs/d1-kysely/bati.config.mjs +1 -1
  10. package/dist/boilerplates/@batijs/d1-sqlite/bati.config.mjs +4 -18
  11. package/dist/boilerplates/@batijs/docker-compose/bati.config.mjs +2 -14
  12. package/dist/boilerplates/@batijs/dokploy/bati.config.mjs +2 -14
  13. package/dist/boilerplates/@batijs/drizzle/bati.config.mjs +1 -17
  14. package/dist/boilerplates/@batijs/edgeone/bati.config.mjs +2 -14
  15. package/dist/boilerplates/@batijs/elysia/bati.config.mjs +2 -15
  16. package/dist/boilerplates/@batijs/eslint/bati.config.mjs +2 -14
  17. package/dist/boilerplates/@batijs/express/bati.config.mjs +2 -15
  18. package/dist/boilerplates/@batijs/fastify/bati.config.mjs +2 -15
  19. package/dist/boilerplates/@batijs/google-analytics/bati.config.mjs +2 -14
  20. package/dist/boilerplates/@batijs/hono/bati.config.mjs +2 -15
  21. package/dist/boilerplates/@batijs/kysely/bati.config.mjs +2 -16
  22. package/dist/boilerplates/@batijs/mantine/bati.config.mjs +2 -14
  23. package/dist/boilerplates/@batijs/netlify/bati.config.mjs +4 -18
  24. package/dist/boilerplates/@batijs/oxlint/bati.config.mjs +2 -14
  25. package/dist/boilerplates/@batijs/plausible.io/bati.config.mjs +4 -18
  26. package/dist/boilerplates/@batijs/pnpm/bati.config.mjs +1 -1
  27. package/dist/boilerplates/@batijs/postgres/bati.config.mjs +1 -13
  28. package/dist/boilerplates/@batijs/prettier/bati.config.mjs +2 -14
  29. package/dist/boilerplates/@batijs/prisma/bati.config.mjs +2 -20
  30. package/dist/boilerplates/@batijs/react/bati.config.mjs +2 -14
  31. package/dist/boilerplates/@batijs/react-better-auth/bati.config.mjs +1 -1
  32. package/dist/boilerplates/@batijs/react-sentry/bati.config.mjs +1 -1
  33. package/dist/boilerplates/@batijs/sentry/bati.config.mjs +1 -14
  34. package/dist/boilerplates/@batijs/shadcn-ui/bati.config.mjs +4 -19
  35. package/dist/boilerplates/@batijs/shared/bati.config.mjs +1 -94
  36. package/dist/boilerplates/@batijs/shared-agents/bati.config.mjs +2 -7
  37. package/dist/boilerplates/@batijs/shared-agents/hooks/after.mjs +17 -7
  38. package/dist/boilerplates/@batijs/shared-agents/hooks/asset-boilerplates/shared-agents/compose.mjs +14 -35
  39. package/dist/boilerplates/@batijs/shared-agents/hooks/asset-packages/features/dist/{features-CStxEDu3.mjs → features-CGdfnf9U.mjs} +110 -84
  40. package/dist/boilerplates/@batijs/shared-agents/hooks/asset-packages/features/dist/index.mjs +5 -158
  41. package/dist/boilerplates/@batijs/shared-db/bati.config.mjs +1 -1
  42. package/dist/boilerplates/@batijs/shared-env/bati.config.mjs +1 -1
  43. package/dist/boilerplates/@batijs/shared-server/bati.config.mjs +1 -1
  44. package/dist/boilerplates/@batijs/shared-todo/bati.config.mjs +1 -1
  45. package/dist/boilerplates/@batijs/solid/bati.config.mjs +4 -18
  46. package/dist/boilerplates/@batijs/solid-better-auth/bati.config.mjs +1 -1
  47. package/dist/boilerplates/@batijs/solid-sentry/bati.config.mjs +1 -1
  48. package/dist/boilerplates/@batijs/sqlite/bati.config.mjs +1 -13
  49. package/dist/boilerplates/@batijs/storybook/bati.config.mjs +2 -14
  50. package/dist/boilerplates/@batijs/tailwindcss/bati.config.mjs +2 -27
  51. package/dist/boilerplates/@batijs/telefunc/bati.config.mjs +4 -20
  52. package/dist/boilerplates/@batijs/trpc/bati.config.mjs +4 -19
  53. package/dist/boilerplates/@batijs/ts-rest/bati.config.mjs +2 -14
  54. package/dist/boilerplates/@batijs/universal-deploy/bati.config.mjs +4 -21
  55. package/dist/boilerplates/@batijs/vercel/bati.config.mjs +1 -13
  56. package/dist/boilerplates/@batijs/vue/bati.config.mjs +2 -14
  57. package/dist/boilerplates/@batijs/vue-better-auth/bati.config.mjs +1 -1
  58. package/dist/boilerplates/@batijs/vue-sentry/bati.config.mjs +1 -1
  59. package/dist/index.js +2 -6
  60. package/package.json +5 -5
  61. package/dist/boilerplates/@batijs/shared-agents/hooks/asset-boilerplates/shared-agents/agents-md.mjs +0 -70
@@ -1,15 +1,25 @@
1
- import { buildAgentsMd } from "./asset-boilerplates/shared-agents/agents-md.mjs";
2
- import { composeAgentFiles } from "./asset-boilerplates/shared-agents/compose.mjs";
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, { skills, env }) {
7
- const agentFiles = composeAgentFiles(meta, skills, buildAgentsMd(meta, env.length > 0));
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 };
@@ -1,44 +1,23 @@
1
- import { resolveInstructionFiles, resolveSkillDirs } from "../../asset-packages/features/dist/index.mjs";
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
- * Materialize the agent files for a scaffold (SKILLS_PLAN.md §3/§4): every skill written to each
5
- * minimal skills dir, plus the canonical `AGENTS.md` (= `agentsBody`) and its `@AGENTS.md` shims.
6
- * Output order is deterministic (canonical agent order; skills sorted by name) for stable snapshots.
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 composeAgentFiles(meta, skills, agentsBody) {
9
- assertUniqueNames(skills);
10
- const selected = meta.BATI.aiAgents;
11
- const sortedSkills = [...skills].sort((a, b) => a.name.localeCompare(b.name));
12
- const files = [];
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
- /** Serialize a skill to a `SKILL.md` document (YAML frontmatter + body). */
24
- function renderSkillMd(skill) {
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 { composeAgentFiles };
23
+ export { composeSkills };