@frontfactory/brigade 1.1.0 → 1.1.1

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/README.md CHANGED
@@ -49,8 +49,8 @@ an answer does) or to leave everything as it is. Without a terminal, it updates.
49
49
 
50
50
  An existing file is never overwritten. If it differs from the kit, a `.proposed` file is written next to it; if it is
51
51
  identical, nothing happens. A file Brigade wrote and nobody touched is updated. `.gitignore` and `.gitattributes` only
52
- get the lines they miss. `.claude/context/decisions.md` is written once and then belongs to the team: it is never
53
- updated nor proposed over.
52
+ get the lines they miss. `.claude/context/decisions.md` and `.claude/context/architecture.md` are written once and then belong to the
53
+ project: they are never updated nor proposed over.
54
54
 
55
55
  ## Update
56
56
 
@@ -63,7 +63,8 @@ the answers the older version does not know. To change your options on purpose,
63
63
  and choose "Change my options".
64
64
 
65
65
  Brigade records what it did in `.claude/brigade.json`: its version, your answers and the sha256 of each file it wrote.
66
- That is how it tells an untouched file from an edited one. Do not edit it by hand.
66
+ That is how it tells an untouched file from an edited one. Do not edit it by hand. Commit it with the rest of `.claude/`:
67
+ the install is shared by the whole team, and anyone can then update it from any machine.
67
68
 
68
69
  ## Troubleshooting
69
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontfactory/brigade",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Sets up a Claude Code architecture in any web project: a main session, a Sonnet implementer, a Haiku git-operator and a git guard.",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/cli.js CHANGED
@@ -69,7 +69,7 @@ function print(result, interactive) {
69
69
 
70
70
  if (!interactive) {
71
71
  const news = added ? `\n\nNew options, default used: ${added}` : '';
72
- console.log(`Brigade installed (stack: ${result.stack}).\n\n${files}\n\n${settings}${news}`);
72
+ console.log(`Brigade installed (stack: ${result.stack}).\n\n${files}\n\n${settings}${news}\n\nCommit .claude/ including .claude/brigade.json so the install is shared with your team and can be updated from any machine.`);
73
73
  return;
74
74
  }
75
75
 
@@ -78,7 +78,7 @@ function print(result, interactive) {
78
78
  if (added) prompter.info(`New options set up: ${added}`);
79
79
  if (kept) prompter.warn('Some files of yours differ from the kit: they were kept. Merge the .proposed version if you want it.');
80
80
  if (!repo) prompter.warn('Remember to run `git init` before your first commit.');
81
- prompter.outro('Done. Run `claude` here, use Plan Mode (Shift+Tab) to discuss, and /brigade-language and /brigade-effort for your own settings.');
81
+ prompter.outro('Done. Commit `.claude/` with `.claude/brigade.json` to share the install with your team: anyone can then update it from any machine. Run `claude` here, use Plan Mode (Shift+Tab) to discuss, and /brigade-language and /brigade-effort for your own settings.');
82
82
  }
83
83
 
84
84
  const isHelp = (arg) => arg === '--help' || arg === '-h';
package/src/init.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { isGitRepo } from './detect.js';
2
- import { appendMissingLines, installFiles, readManifest, writeLocalSettings, writeManifest } from './install.js';
2
+ import { appendMissingLines, hasKitFiles, installFiles, MANIFEST, readManifest, writeLocalSettings, writeManifest } from './install.js';
3
3
  import { askOptions } from './options.js';
4
4
  import { createPrompter } from './prompt.js';
5
5
  import { DEFAULT_STACK, STACKS, detectStack } from './stacks.js';
@@ -50,6 +50,9 @@ export async function runInit({ cwd, yes = false, stack, stackDir, version = VER
50
50
  if (!repo) {
51
51
  prompter.warn('No git repository here. Brigade will not create one: run `git init` when you are ready. The branch names below are kept for then.');
52
52
  }
53
+ if (!previous && hasKitFiles({ cwd, stackDir: dir })) {
54
+ prompter.warn(`${MANIFEST} is missing but Brigade files already exist here. Nothing is overwritten: files identical to the kit are adopted and files that differ get a .proposed. If the manifest exists in your team's repo, restore it from git first.`);
55
+ }
53
56
  // A version change replays the kit with the stored answers and only asks the missing options. Otherwise (first
54
57
  // install, same version) every question is asked.
55
58
  const update = choice === 'update' && installed !== version;
package/src/install.js CHANGED
@@ -11,10 +11,10 @@ const APPENDS = {
11
11
  };
12
12
 
13
13
  // Written once, then the team's own: never updated, never proposed over.
14
- const WRITE_ONCE = new Set(['.claude/context/decisions.md']);
14
+ const WRITE_ONCE = new Set(['.claude/context/decisions.md', '.claude/context/architecture.md']);
15
15
 
16
16
  // Line endings do not count: a CRLF checkout of a kit file is the same file.
17
- const sha = (content) => createHash('sha256').update(content.replace(/\r\n/g, '\n')).digest('hex');
17
+ export const sha = (content) => createHash('sha256').update(content.replace(/\r\n/g, '\n')).digest('hex');
18
18
 
19
19
  function listFiles(dir) {
20
20
  return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
@@ -24,6 +24,11 @@ function listFiles(dir) {
24
24
  });
25
25
  }
26
26
 
27
+ // True when the project already holds at least one file of the kit.
28
+ export function hasKitFiles({ cwd, stackDir }) {
29
+ return listFiles(stackDir).some((source) => existsSync(join(cwd, relative(stackDir, source))));
30
+ }
31
+
27
32
  export function render(content, answers) {
28
33
  const values = {
29
34
  DEFAULT_BRANCH: answers.defaultBranch,