Skip to content

Commit f7e6131

Browse files
authored
Add intent install to CLI next steps (#168)
Add intent install to CLI next steps Add agent intent install to CLI next steps Add agent instructions to scaffold templates Inject agent instructions from template constants Simplify scaffold agent instructions Refine scaffold agent instructions <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added agent instruction guidance into the project-creation flow and next-steps output * CLI now displays a required agent install command during setup * **Documentation** * New agent instruction placeholder files added to project templates for downstream projects <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent d7f86a4 commit f7e6131

9 files changed

Lines changed: 44 additions & 11 deletions

File tree

packages/cli/src/consts.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,26 @@ const versionCharLength = version.length;
1616
//export const PKG_ROOT = path.dirname(require.main.filename);
1717

1818
export const TITLE_TEXT = `
19-
_______ ___ ___ ____ _ _
20-
|_ __ \\ .' ..]|_ ||_ _| (_) / |_
19+
_______ ___ ___ ____ _ _
20+
|_ __ \\ .' ..]|_ ||_ _| (_) / |_
2121
| |__) |_ .--. .--. .--. _| |_ | |_/ / __ \`| |-'
22-
| ___/[ \`/'\`\\]/ .'\`\\ \\/ .'\`\\ \\'-| |-' | __'. [ | | |
23-
_| |_ | | | \\__. || \\__. | | | _| | \\ \\_ | | | |,
24-
|_____| [___] '.__.' '.__.' [___] |____||____|[___]\\__/
22+
| ___/[ \`/'\`\\]/ .'\`\\ \\/ .'\`\\ \\'-| |-' | __'. [ | | |
23+
_| |_ | | | \\__. || \\__. | | | _| | \\ \\_ | | | |,
24+
|_____| [___] '.__.' '.__.' [___] |____||____|[___]\\__/
2525
${" ".repeat(61 - versionCharLength)}v${version}
2626
`;
2727
export const DEFAULT_APP_NAME = "my-proofkit-app";
2828
export const CREATE_FM_APP = cliName;
29+
export const AGENT_INSTRUCTIONS = [
30+
"Use the ProofKit docs as the primary reference for this project: https://proofkit.dev/docs",
31+
"Before doing any AI-assisted development here, run `npx @tanstack/intent@latest install` in the project root to load skills relevant to this project",
32+
].join("\n");
2933

3034
// Registry URL is injected at build time via tsdown define
3135
declare const __REGISTRY_URL__: string;
3236
// Provide a safe fallback when running from source (not built)
3337
export const DEFAULT_REGISTRY_URL =
3438
// typeof check avoids ReferenceError if not defined at runtime
35-
typeof __REGISTRY_URL__ !== "undefined" && __REGISTRY_URL__ ? __REGISTRY_URL__ : "https://proofkit.dev";
39+
typeof __REGISTRY_URL__ !== "undefined" && __REGISTRY_URL__
40+
? __REGISTRY_URL__
41+
: "https://proofkit.dev";

packages/cli/src/helpers/createProject.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from "node:path";
22

3+
import { AGENT_INSTRUCTIONS } from "~/consts.js";
34
import { installPackages } from "~/helpers/installPackages.js";
45
import { scaffoldProject } from "~/helpers/scaffoldProject.js";
56
import type { AvailableDependencies } from "~/installers/dependencyVersionMap.js";
@@ -130,6 +131,7 @@ export const createBareProject = async ({
130131

131132
replaceTextInFiles(state.projectDir, "__PNPM_COMMAND__", pkgManagerCommand);
132133
replaceTextInFiles(state.projectDir, "__PACKAGE_MANAGER__", pkgManager);
134+
replaceTextInFiles(state.projectDir, "__AGENT_INSTRUCTIONS__", AGENT_INSTRUCTIONS);
133135

134136
return state.projectDir;
135137
};

packages/cli/src/helpers/logNextSteps.ts

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ import { state } from "~/state.js";
66
import { getUserPkgManager } from "~/utils/getUserPkgManager.js";
77
import { logger } from "~/utils/logger.js";
88

9-
const formatRunCommand = (pkgManager: ReturnType<typeof getUserPkgManager>, command: string) =>
10-
["npm", "bun"].includes(pkgManager) ? `${pkgManager} run ${command}` : `${pkgManager} ${command}`;
9+
const formatRunCommand = (
10+
pkgManager: ReturnType<typeof getUserPkgManager>,
11+
command: string,
12+
) =>
13+
["npm", "bun"].includes(pkgManager)
14+
? `${pkgManager} run ${command}`
15+
: `${pkgManager} ${command}`;
1116

1217
// This logs the next steps that the user should take in order to advance the project
1318
export const logNextSteps = ({
@@ -19,7 +24,9 @@ export const logNextSteps = ({
1924
logger.info(chalk.bold("Next steps:"));
2025
logger.dim("\nNavigate to the project directory:");
2126
projectName !== "." && logger.info(` cd ${projectName}`);
22-
logger.dim("(or open in your code editor, and run the rest of these commands from there)");
27+
logger.dim(
28+
"(or open in your code editor, and run the rest of these commands from there)",
29+
);
2330

2431
if (noInstall) {
2532
logger.dim("\nInstall dependencies:");
@@ -31,18 +38,30 @@ export const logNextSteps = ({
3138
}
3239
}
3340

41+
logger.dim(
42+
"\nAgent instruction (required before continuing any AI-assisted development in this project):",
43+
);
44+
logger.info(" npx @tanstack/intent@latest install");
45+
logger.dim(
46+
" Have your agent run this command in the newly created project so it can discover and learn important skills relevant to the project.",
47+
);
48+
3449
logger.dim("\nStart the dev server to view your app in a browser:");
3550
logger.info(` ${formatRunCommand(pkgManager, "dev")}`);
3651

3752
if (state.appType === "webviewer") {
3853
logger.dim("\nWhen you're ready to generate FileMaker clients:");
3954
logger.info(` ${formatRunCommand(pkgManager, "typegen")}`);
4055

41-
logger.dim("\nTo open the starter inside FileMaker once your file is ready:");
56+
logger.dim(
57+
"\nTo open the starter inside FileMaker once your file is ready:",
58+
);
4259
logger.info(` ${formatRunCommand(pkgManager, "launch-fm")}`);
4360
}
4461

45-
logger.dim("\nOr, run the ProofKit command again to add more to your project:");
62+
logger.dim(
63+
"\nOr, run the ProofKit command again to add more to your project:",
64+
);
4665
logger.info(` ${formatRunCommand(pkgManager, "proofkit")}`);
4766
logger.dim("(Must be inside the project directory)");
4867
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__AGENT_INSTRUCTIONS__
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__AGENT_INSTRUCTIONS__
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__AGENT_INSTRUCTIONS__
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

0 commit comments

Comments
 (0)