thomas-agentkit 0.5.2 → 0.6.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.
Files changed (3) hide show
  1. package/README.md +25 -3
  2. package/dist/cli.js +26 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -14,7 +14,14 @@ Install templates into the current directory:
14
14
  npx thomas-agentkit init
15
15
  ```
16
16
 
17
- By default, `init` opens a short interactive setup flow in terminals. After choosing install options, you can optionally personalize repository-level template placeholders such as project name, description, issue tracker, docs paths, stack summary, and project commands.
17
+ If the package is installed in a project, use the local `agentkit` binary:
18
+
19
+ ```bash
20
+ npm install -D thomas-agentkit
21
+ npx agentkit init
22
+ ```
23
+
24
+ By default, `init` opens a short interactive setup flow in terminals. It asks where to install files, what project type or preset to use, which AI tools you use, which template set to install, how to handle existing files, and whether to personalize repository-level placeholders such as project name, description, issue tracker, docs paths, stack summary, and project commands.
18
25
 
19
26
  Install into another directory:
20
27
 
@@ -98,6 +105,8 @@ npx thomas-agentkit init --write-config
98
105
 
99
106
  `--write-config` writes `agentkit.config.json` in the target directory. Existing config files are skipped by default; use `--force` to overwrite one intentionally.
100
107
 
108
+ Config values are validated when loaded. Unknown config keys, invalid preset/template/design-system names, invalid AI tool names, and non-string personalization values exit with an error.
109
+
101
110
  List bundled templates:
102
111
 
103
112
  ```bash
@@ -145,12 +154,25 @@ Generated content
145
154
  <!-- agentkit:end agents -->
146
155
  ```
147
156
 
148
- `agentkit update` only replaces content inside matching managed blocks. User edits before or after those blocks are preserved. Existing legacy files without managed blocks are reported as unmanaged and left untouched.
157
+ `agentkit update` creates missing managed files. For existing files, it only replaces content inside matching managed blocks. User edits before or after those blocks are preserved. Existing legacy files without managed blocks are reported as unmanaged and left untouched. Files with malformed managed block markers are skipped.
149
158
 
150
- Interactive personalization only applies during `agentkit init` when files are created or overwritten. It does not write a config file, and `agentkit update` does not reapply personalized values.
159
+ Interactive personalization only applies during `agentkit init` when files are created or overwritten. It does not write a config file unless `--write-config` is passed, and `agentkit update` does not reapply personalized values.
151
160
 
152
161
  `agentkit.config.json` can set `preset`, `templateSet`, `designSystem`, `aiTools`, and `personalization` defaults. `templateSet` may be `minimal`, `standard`, or `full`; `designSystem` selects which bundled design-system variant fills `DESIGN-SYSTEM.md` (`linear` or `apple`); `aiTools` may include `codex`, `cursor`, `claude`, and `copilot`. `agentkit update` uses config `preset` and `designSystem` and continues to update all managed bundled templates.
153
162
 
163
+ Template set mappings:
164
+
165
+ - `minimal`: `AGENTS.md`
166
+ - `standard`: `AGENTS.md`, `CODE-QUALITY.md`, `DESIGN-SYSTEM.md`, `WORKFLOWS.md`
167
+ - `full`: all bundled templates
168
+
169
+ AI tool mappings:
170
+
171
+ - `codex`: `AGENTS.md`
172
+ - `cursor`: `.cursor/rules/agentkit.md`
173
+ - `claude`: `CLAUDE.md`
174
+ - `copilot`: `.github/copilot-instructions.md`
175
+
154
176
  ## Presets
155
177
 
156
178
  Presets add stack-specific guidance without scaffolding framework app files.
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { confirm, intro, isCancel, multiselect, select, text } from "@clack/prompts";
3
3
  import { Command } from "commander";
4
- import { constants as fsConstants } from "node:fs";
4
+ import { constants as fsConstants, realpathSync } from "node:fs";
5
5
  import { access, mkdir, readdir, readFile, stat, writeFile } from "node:fs/promises";
6
6
  import path from "node:path";
7
7
  import { fileURLToPath } from "node:url";
@@ -483,6 +483,18 @@ export function personalizeTemplateContent(file, content, values) {
483
483
  }
484
484
  return personalized;
485
485
  }
486
+ export function shouldPromptForInit(options, streams) {
487
+ if (options.yes) {
488
+ return false;
489
+ }
490
+ if (options.interactive) {
491
+ return true;
492
+ }
493
+ if (options.dryRun) {
494
+ return false;
495
+ }
496
+ return Boolean(streams.stdin?.isTTY || streams.stdout?.isTTY);
497
+ }
486
498
  async function promptForPersonalization(defaults) {
487
499
  const shouldPersonalize = await confirm({
488
500
  message: "Personalize template placeholders?",
@@ -760,7 +772,7 @@ function printUpdateResult(result, dryRun = false) {
760
772
  }
761
773
  async function resolveInteractiveTarget(target, options) {
762
774
  const providedPreset = resolvePreset(options.preset);
763
- const shouldPrompt = !options.yes && (options.interactive || process.stdin.isTTY);
775
+ const shouldPrompt = shouldPromptForInit(options, process);
764
776
  if (!shouldPrompt) {
765
777
  return target;
766
778
  }
@@ -932,7 +944,18 @@ Examples:
932
944
  });
933
945
  await program.parseAsync(process.argv);
934
946
  }
935
- if (process.argv[1] && path.resolve(process.argv[1]) === __filename) {
947
+ function resolveCliPath(filePath) {
948
+ try {
949
+ return realpathSync(filePath);
950
+ }
951
+ catch {
952
+ return path.resolve(filePath);
953
+ }
954
+ }
955
+ function isDirectCliInvocation(argvPath) {
956
+ return Boolean(argvPath && resolveCliPath(argvPath) === resolveCliPath(__filename));
957
+ }
958
+ if (isDirectCliInvocation(process.argv[1])) {
936
959
  main().catch((error) => {
937
960
  const message = error instanceof Error ? error.message : String(error);
938
961
  console.error(message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thomas-agentkit",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "description": "Install AI-agent-ready development templates into a project.",
5
5
  "license": "MIT",
6
6
  "repository": {