create-cofounder 0.1.2 → 0.1.4

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 +13 -7
  2. package/index.js +50 -5
  3. package/package.json +10 -1
package/README.md CHANGED
@@ -1,16 +1,22 @@
1
1
  # create-cofounder
2
2
 
3
- Initializer for Cofounder Crew project config.
3
+ Initializer for Cofounder Crew projects.
4
4
 
5
5
  ```bash
6
- npm create cofounder@latest
7
- npm create cofounder@latest -- --template worktree --setup-codex --yes
6
+ npm create cofounder@latest -- --setup-codex --yes
7
+ codex
8
8
  ```
9
9
 
10
- This creates a `.cofounder/` skeleton in the current project and can optionally install the Codex MCP entry.
10
+ This creates a `.cofounder/` team skeleton, adds Codex-facing project instructions when `AGENTS.md` is not already present, and can install the Codex MCP entry.
11
11
 
12
- `npm create` does not install a persistent `cofounder` shell command. For one-off runtime commands:
12
+ If `AGENTS.md` already exists, Cofounder will not modify it. Add the short Cofounder bridge block printed by the initializer so Codex knows to read `.cofounder/codex-instructions.md`.
13
13
 
14
- ```bash
15
- npx -y --package cofounder-crew -- cofounder team
14
+ After initialization, the intended interface is Codex chat:
15
+
16
+ ```text
17
+ Use the Cofounder team. Show me who is available.
18
+ Ask backend to inspect this repo.
19
+ Help me add or adjust a Cofounder teammate.
16
20
  ```
21
+
22
+ The `worktree` template requires a Git repository with at least one commit before delegated tasks can run in isolated worktrees.
package/index.js CHANGED
@@ -13,16 +13,31 @@ async function main(argv = process.argv.slice(2)) {
13
13
  const template = answers.template ?? "default";
14
14
 
15
15
  await runCofounder(["init", "--template", template], { inherit: true });
16
+ if (template === "worktree" && !(await hasGitHead())) {
17
+ printWorktreePrerequisiteWarning();
18
+ }
16
19
 
17
20
  if (answers.setupCodex) {
18
21
  await runCofounder(["setup", "codex", "--install"], { inherit: true });
19
- } else {
20
- console.log("");
21
- console.log("Next:");
22
+ printConversationNext({ setupInstalled: true });
23
+ return;
24
+ }
25
+
26
+ printConversationNext({ setupInstalled: false });
27
+ }
28
+
29
+ function printConversationNext({ setupInstalled }) {
30
+ console.log("");
31
+ console.log("Next:");
32
+ if (!setupInstalled) {
22
33
  console.log(` ${formatCofounderCommand(["setup", "codex", "--install"])}`);
23
- console.log(` ${formatCofounderCommand(["team"])}`);
24
- console.log(` ${formatCofounderCommand(["delegate", "backend", "inspect this repo and summarize the API boundaries"])}`);
25
34
  }
35
+ console.log(" codex");
36
+ console.log("");
37
+ console.log("Then ask Codex:");
38
+ console.log(' "Use the Cofounder team. Show me who is available."');
39
+ console.log(' "Ask backend to inspect this repo and summarize the implementation boundaries."');
40
+ console.log(' "Help me add or adjust a Cofounder teammate for this project."');
26
41
  }
27
42
 
28
43
  function parseArgs(args) {
@@ -122,6 +137,36 @@ function formatCofounderCommand(args) {
122
137
  return ["npx", ...resolveNpxCofounderArgs(args)].map(quoteShellArg).join(" ");
123
138
  }
124
139
 
140
+ async function hasGitHead() {
141
+ return commandSucceeds("git", ["rev-parse", "--verify", "HEAD"]);
142
+ }
143
+
144
+ async function commandSucceeds(bin, args) {
145
+ return new Promise((resolve) => {
146
+ const child = spawn(bin, args, {
147
+ cwd: process.cwd(),
148
+ env: process.env,
149
+ stdio: "ignore"
150
+ });
151
+ child.on("error", () => resolve(false));
152
+ child.on("close", (code) => resolve(code === 0));
153
+ });
154
+ }
155
+
156
+ function printWorktreePrerequisiteWarning() {
157
+ console.log("");
158
+ console.log("Warning:");
159
+ console.log(" worktree template needs a Git repository with at least one commit before delegation.");
160
+ console.log(" Worktrees are created from HEAD, so commit the baseline delegated agents should see.");
161
+ console.log("");
162
+ console.log(" For a scratch test:");
163
+ console.log(" git init");
164
+ console.log(" git add .");
165
+ console.log(' git commit -m "chore: initial commit"');
166
+ console.log("");
167
+ console.log(' Or use direct mode by setting mode = "direct" under [write] in .cofounder/members/backend/settings.toml.');
168
+ }
169
+
125
170
  function quoteShellArg(value) {
126
171
  if (/^[A-Za-z0-9_./:@%+=,-]+$/.test(value)) {
127
172
  return value;
package/package.json CHANGED
@@ -1,7 +1,16 @@
1
1
  {
2
2
  "name": "create-cofounder",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Initializer for Cofounder Crew projects",
5
+ "homepage": "https://github.com/eugeneyvt/cofounder-crew#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/eugeneyvt/cofounder-crew/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/eugeneyvt/cofounder-crew.git",
12
+ "directory": "packages/create-cofounder"
13
+ },
5
14
  "type": "module",
6
15
  "bin": {
7
16
  "create-cofounder": "index.js"