@kudusov.takhir/ba-toolkit 3.13.1 → 4.0.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.
package/CHANGELOG.md CHANGED
@@ -11,6 +11,31 @@ Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
11
 
12
12
  ---
13
13
 
14
+ ## [4.0.0] — 2026-04-11
15
+
16
+ ### Changed
17
+
18
+ - **AGENTS.md now lives at the project root** instead of inside `output/<slug>/`. One directory = one project.
19
+ - **Artifacts save to `output/`** (flat) instead of `output/<slug>/`. The slug is still used in filenames (`01_brief_<slug>.md`) but not in directory structure.
20
+ - **`ba-toolkit init` warns** when `output/` already contains artifacts from a previous project, instead of silently creating a new subfolder.
21
+ - **Skills detect AGENTS.md** at cwd or `../AGENTS.md` (when cwd is `output/`), no longer walking up the full directory tree.
22
+ - **`ba-toolkit publish`** error message and help text updated to reference `output/` instead of `output/<slug>/`.
23
+ - **Shell fallbacks** (`init.sh`, `init.ps1`) updated to match the new layout.
24
+
25
+ ### Removed
26
+
27
+ - **Multi-project support.** The v3.x `output/<slug>/` per-project subfolder layout is removed. Each directory is now a single project. Running `ba-toolkit init` twice in the same directory merges into the existing root `AGENTS.md` (managed-block merge is preserved).
28
+
29
+ ### Migration from v3.x
30
+
31
+ If you have an existing v3.x project with `output/<slug>/AGENTS.md`:
32
+ 1. Move `output/<slug>/AGENTS.md` to the project root.
33
+ 2. Move artifacts from `output/<slug>/*.md` to `output/`.
34
+ 3. Remove the empty `output/<slug>/` directory.
35
+ 4. Run `ba-toolkit upgrade --for <agent>` to refresh the installed skills.
36
+
37
+ ---
38
+
14
39
  ## [3.13.1] — 2026-04-11
15
40
 
16
41
  ### Added
@@ -847,6 +872,7 @@ CI scripts that relied on the old behaviour (`init` creates files only, `install
847
872
  ---
848
873
 
849
874
  [Unreleased]: https://github.com/TakhirKudusov/ba-toolkit/compare/v3.10.1...HEAD
875
+ [4.0.0]: https://github.com/TakhirKudusov/ba-toolkit/compare/v3.13.1...v4.0.0
850
876
  [3.13.1]: https://github.com/TakhirKudusov/ba-toolkit/compare/v3.13.0...v3.13.1
851
877
  [3.13.0]: https://github.com/TakhirKudusov/ba-toolkit/compare/v3.12.0...v3.13.0
852
878
  [3.12.0]: https://github.com/TakhirKudusov/ba-toolkit/compare/v3.11.0...v3.12.0
package/README.md CHANGED
@@ -40,8 +40,8 @@ Artifacts are generated in whatever language you write in — ask in English, ge
40
40
 
41
41
  ```bash
42
42
  # Full setup in one command — prompts for project name, domain, and
43
- # AI agent, then creates output/{slug}/, AGENTS.md, and installs the
44
- # skills into the chosen agent's directory.
43
+ # AI agent, then creates output/, AGENTS.md, and installs the skills
44
+ # into the chosen agent's directory.
45
45
  npx @kudusov.takhir/ba-toolkit init
46
46
 
47
47
  # Non-interactive (e.g. for CI): pass every choice on the command line.
@@ -54,9 +54,8 @@ ba-toolkit init
54
54
 
55
55
  Supported agents: `claude-code`, `codex`, `gemini`, `cursor`, `windsurf`. All five use the native Agent Skills format (folder-per-skill with `SKILL.md`) — Claude Code at `.claude/skills/`, Codex at `~/.codex/skills/`, Gemini at `.gemini/skills/`, Cursor at `.cursor/skills/`, Windsurf at `.windsurf/skills/`. Pass `--dry-run` to preview the install step without writing files, or `--no-install` to create only the project structure and install skills later with `ba-toolkit install --for <agent>`.
56
56
 
57
- **New in v3.1** — multi-project + interview UX:
57
+ **New in v3.1** — interview UX:
58
58
 
59
- - **Multi-project: each `ba-toolkit init` creates `output/<slug>/AGENTS.md`**, scoped to that project. Two agent windows in the same repo can `cd output/alpha && claude` and `cd output/beta && claude` independently — no AGENTS.md collision, no shared state.
60
59
  - **Interview options as a 2-column table with letter IDs** (`a`, `b`, `c`, …) instead of a numbered list. Renders cleanly across all 5 supported agents, easier to scan, last row is always free-text "Other".
61
60
  - **Inline context after slash commands**: `/brief I want to build an online store for construction materials...` is parsed as a lead-in answer; the skill skips redundant questions and jumps straight to what's missing. Works for all 12 interview-phase skills.
62
61
  - **Open-ended lead-in question** for `/brief` and `/principles` when there's no inline context — `Tell me about the project in your own words` — instead of dumping a structured table on the first turn.
@@ -140,7 +139,7 @@ bash init.sh
140
139
  .\init.ps1
141
140
  ```
142
141
 
143
- Equivalent to `npx @kudusov.takhir/ba-toolkit init` — asks for a slug, name, and domain, then creates `output/{slug}/` and an `AGENTS.md` with the pipeline status table.
142
+ Equivalent to `npx @kudusov.takhir/ba-toolkit init` — asks for a slug, name, and domain, then creates `output/` and an `AGENTS.md` with the pipeline status table.
144
143
 
145
144
  ### Updating a manual install
146
145
 
@@ -364,7 +363,7 @@ Use `/clarify` at any step to resolve ambiguities before moving on. Approximate
364
363
 
365
364
  ## Usage guide
366
365
 
367
- Full walkthrough of the pipeline in day-to-day use — starting a project, moving between steps, `/clarify`, `/analyze`, `/trace`, `/split`, working with multiple projects, and `AGENTS.md` — lives in [docs/USAGE.md](docs/USAGE.md).
366
+ Full walkthrough of the pipeline in day-to-day use — starting a project, moving between steps, `/clarify`, `/analyze`, `/trace`, `/split`, and `AGENTS.md` — lives in [docs/USAGE.md](docs/USAGE.md).
368
367
 
369
368
  For common issues and fixes, see [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md).
370
369
 
package/bin/ba-toolkit.js CHANGED
@@ -956,22 +956,21 @@ async function cmdInit(args) {
956
956
  log('');
957
957
  log(' ' + green('Creating project structure...'));
958
958
 
959
- const outputDir = path.join('output', slug);
959
+ const outputDir = 'output';
960
960
  if (!fs.existsSync(outputDir)) {
961
961
  fs.mkdirSync(outputDir, { recursive: true });
962
- log(` created ${outputDir}`);
962
+ log(` created ${outputDir}/`);
963
963
  } else {
964
- log(` exists ${outputDir}`);
964
+ // Warn if output/ already contains artifacts from a previous project.
965
+ const existing = fs.readdirSync(outputDir).filter((f) => ARTIFACT_FILE_RE.test(f));
966
+ if (existing.length > 0) {
967
+ log(' ' + yellow(`⚠ output/ already has ${existing.length} artifact(s). Pipeline skills may overwrite them.`));
968
+ } else {
969
+ log(` exists ${outputDir}/`);
970
+ }
965
971
  }
966
972
 
967
- // AGENTS.md: per-project, lives inside output/<slug>/. Two agent
968
- // windows can now work on two different projects in the same repo
969
- // without colliding — each cd-s into its own output/<slug>/ folder
970
- // and finds its own AGENTS.md there. The merge-on-reinit behaviour
971
- // (managed-block anchors) still applies, just at per-project scope.
972
- // See mergeAgentsMd for the three branches (created, merged,
973
- // preserved).
974
- const agentsPath = path.join(outputDir, 'AGENTS.md');
973
+ const agentsPath = 'AGENTS.md';
975
974
  const existingAgents = fs.existsSync(agentsPath)
976
975
  ? fs.readFileSync(agentsPath, 'utf8')
977
976
  : null;
@@ -1004,34 +1003,32 @@ async function cmdInit(args) {
1004
1003
 
1005
1004
  // --- 7. Final message ---
1006
1005
  log('');
1007
- log(' ' + cyan(`Project '${name}' (${slug}) is ready in ${outputDir}/.`));
1006
+ log(' ' + cyan(`Project '${name}' (${slug}) is ready.`));
1008
1007
  log('');
1009
1008
  log(' ' + yellow('Next steps:'));
1010
1009
  if (installed === true) {
1011
1010
  log(' 1. ' + AGENTS[agentId].restartHint);
1012
- log(' 2. ' + bold(`cd ${outputDir}`) + ' — open your AI agent in this folder.');
1013
- log(' Each project has its own AGENTS.md, so two agent windows');
1014
- log(' can work on two different projects in the same repo.');
1011
+ log(' 2. Open your AI agent in this folder.');
1015
1012
  log(' 3. Optional: run /discovery if you do not yet know what to build,');
1016
1013
  log(' or /principles to define project-wide conventions');
1017
1014
  log(' 4. Run /brief to start the BA pipeline');
1018
1015
  } else if (installed === false) {
1019
1016
  log(' 1. Skill install was cancelled. To install later, run:');
1020
1017
  log(' ' + gray(`ba-toolkit install --for ${agentId}`));
1021
- log(' 2. ' + bold(`cd ${outputDir}`) + ' and open your AI agent there.');
1018
+ log(' 2. Open your AI agent in this folder.');
1022
1019
  log(' 3. Optional: run /discovery if you do not yet know what to build,');
1023
1020
  log(' or /principles to define project-wide conventions');
1024
1021
  log(' 4. Run /brief to start the BA pipeline');
1025
1022
  } else {
1026
1023
  log(' 1. Install skills for your agent:');
1027
1024
  log(' ' + gray('ba-toolkit install --for claude-code'));
1028
- log(' 2. ' + bold(`cd ${outputDir}`) + ' and open your AI agent there.');
1025
+ log(' 2. Open your AI agent in this folder.');
1029
1026
  log(' 3. Optional: run /discovery if you do not yet know what to build,');
1030
1027
  log(' or /principles to define project-wide conventions');
1031
1028
  log(' 4. Run /brief to start the BA pipeline');
1032
1029
  }
1033
1030
  log('');
1034
- log(' ' + gray(`Artifacts and AGENTS.md live in: ${outputDir}/`));
1031
+ log(' ' + gray('AGENTS.md is at the project root. Artifacts are saved to output/.'));
1035
1032
  log('');
1036
1033
  }
1037
1034
 
@@ -1744,7 +1741,7 @@ async function cmdPublish(args) {
1744
1741
 
1745
1742
  if (artifacts.length === 0) {
1746
1743
  logError(`No BA Toolkit artifacts found in ${cwd}.`);
1747
- log(' Run this command from inside ' + cyan('output/<slug>/') + ' after generating artifacts.');
1744
+ log(' Run this command from inside ' + cyan('output/') + ' after generating artifacts.');
1748
1745
  process.exit(1);
1749
1746
  }
1750
1747
 
@@ -1867,7 +1864,7 @@ ${bold('USAGE')}
1867
1864
  ${bold('COMMANDS')}
1868
1865
  init One-command project setup: prompts for name,
1869
1866
  slug, domain, and AI agent, then creates
1870
- output/{slug}/, AGENTS.md, and installs the
1867
+ output/, AGENTS.md, and installs the
1871
1868
  skills into the chosen agent's directory.
1872
1869
  install --for <agent> Install (or re-install) skills into an
1873
1870
  agent's directory without creating a project.
@@ -1884,7 +1881,7 @@ ${bold('COMMANDS')}
1884
1881
  report which versions are installed where.
1885
1882
  Read-only; no flags.
1886
1883
  publish [--format <fmt>] Bundle the artifacts in the current
1887
- output/<slug>/ folder into import-ready
1884
+ output/ folder into import-ready
1888
1885
  files for Notion (markdown) and Confluence
1889
1886
  (HTML). Format: notion, confluence, or
1890
1887
  both (default). No API calls, no tokens —
@@ -1944,7 +1941,7 @@ ${bold('EXAMPLES')}
1944
1941
  ba-toolkit status
1945
1942
 
1946
1943
  # Bundle a project's artifacts for Notion + Confluence import.
1947
- cd output/my-app
1944
+ cd output
1948
1945
  ba-toolkit publish
1949
1946
  ba-toolkit publish --format notion --out ./share
1950
1947
  ba-toolkit publish --format confluence --dry-run
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kudusov.takhir/ba-toolkit",
3
- "version": "3.13.1",
3
+ "version": "4.0.0",
4
4
  "description": "AI-powered Business Analyst pipeline — 24 skills from concept discovery to a sequenced implementation plan an AI coding agent can execute, with one-command Notion + Confluence publish. Works with Claude Code, Codex CLI, Gemini CLI, Cursor, and Windsurf.",
5
5
  "keywords": [
6
6
  "business-analyst",
@@ -101,7 +101,7 @@ If a domain reference is loaded, supplement general questions with domain-specif
101
101
 
102
102
  ### 6. AGENTS.md update
103
103
 
104
- `ba-toolkit init` already created `AGENTS.md` next to where the artifact lives — typically in the current working directory (the user is expected to `cd output/<slug>` after running init). After saving `01_brief_{slug}.md`, find the project's `AGENTS.md` (look in cwd first; fall back to walking up the directory tree if cwd has none, for legacy v3.0 single-project layouts).
104
+ `ba-toolkit init` already created `AGENTS.md` at the project root. After saving `01_brief_{slug}.md` to `output/`, find the project's `AGENTS.md` (look in cwd first; if cwd is `output/`, check `../AGENTS.md`).
105
105
 
106
106
  **Update only the `## Pipeline Status` row for `/brief`** — toggle its status from `⬜ Not started` to `✅ Done` and fill in the artifact filename in the `File` column. **Do not touch the managed block** (`<!-- ba-toolkit:begin managed -->` … `<!-- ba-toolkit:end managed -->`) — that's owned by `ba-toolkit init`. **Do not recreate the file at the repo root.** **Do not add `## Artifacts` / `## Key context` sections** — those are not part of the v3.1+ template and would be ignored by future runs.
107
107
 
@@ -125,7 +125,7 @@ Things we don't yet know and need to learn before committing real resources.
125
125
 
126
126
  ### 6. AGENTS.md update
127
127
 
128
- `ba-toolkit init` already created `AGENTS.md` next to where the artifact lives — typically in the current working directory (the user is expected to `cd output/<slug>` after running init). After saving `00_discovery_{slug}.md`, find the project's `AGENTS.md` (look in cwd first; fall back to walking up the directory tree if cwd has none, for legacy v3.0 single-project layouts).
128
+ `ba-toolkit init` already created `AGENTS.md` at the project root. After saving `00_discovery_{slug}.md` to `output/`, find the project's `AGENTS.md` (look in cwd first; if cwd is `output/`, check `../AGENTS.md`).
129
129
 
130
130
  **Update only the `## Pipeline Status` row for `/discovery`** — toggle its status from `⬜ Not started` to `✅ Done` and fill in the artifact filename in the `File` column. **Do not recreate the file at the repo root.** **Do not add `## Artifacts` / `## Key context` sections** — those are not part of the v3.1+ template and would be ignored by future runs.
131
131
 
@@ -200,8 +200,8 @@ Compatible with Jira CSV import, Trello, Asana, Monday.com, and Google Sheets. I
200
200
  Save the export file to the output directory alongside the artifacts:
201
201
 
202
202
  ```
203
- output/{slug}/export_{slug}_{format}.json
204
- output/{slug}/export_{slug}_stories.csv (CSV format)
203
+ output/export_{slug}_{format}.json
204
+ output/export_{slug}_stories.csv (CSV format)
205
205
  ```
206
206
 
207
207
  ## Closing message
@@ -246,13 +246,13 @@ Machine-readable dependency graph. A topological sort of this table yields a val
246
246
 
247
247
  ### 8. AGENTS.md update
248
248
 
249
- `ba-toolkit init` already created `AGENTS.md` next to where the artifact lives. After saving `12_implplan_{slug}.md`, find the project's `AGENTS.md` (look in cwd first; fall back to walking up the directory tree if cwd has none, for legacy single-project layouts).
249
+ `ba-toolkit init` already created `AGENTS.md` at the project root. After saving `12_implplan_{slug}.md` to `output/`, find the project's `AGENTS.md` (look in cwd first; if cwd is `output/`, check `../AGENTS.md`).
250
250
 
251
251
  **Update only the `## Pipeline Status` row for `/implement-plan`** — toggle its status from `⬜ Not started` to `✅ Done` and fill in the artifact filename in the `File` column. **Do not touch the managed block** (`<!-- ba-toolkit:begin managed -->` … `<!-- ba-toolkit:end managed -->`) — that's owned by `ba-toolkit init`.
252
252
 
253
253
  If the existing `AGENTS.md` predates v3.4 and has no `/implement-plan` row in its Pipeline Status table, append a new row at stage `12` (the existing rows 0–11 stay as they are, no renumbering). Mention the migration in your reply so the user knows their AGENTS.md was updated.
254
254
 
255
- If you find no `AGENTS.md` at all (neither in cwd nor up the tree), warn the user that the project was likely set up before v3.1 and tell them to run `ba-toolkit init --name "..." --slug {slug}` to scaffold the per-project `AGENTS.md`. Do not create one yourself with arbitrary structure.
255
+ If you find no `AGENTS.md` at all, warn the user that the project was likely not scaffolded with `ba-toolkit init` and tell them to run it. Do not create one yourself with arbitrary structure.
256
256
 
257
257
  ### 9. Iterative refinement
258
258
 
@@ -6,7 +6,7 @@ description: >
6
6
 
7
7
  # /publish — Notion / Confluence Publish
8
8
 
9
- Utility skill. Wraps the `ba-toolkit publish` CLI subcommand, which converts the markdown artifacts in the current `output/<slug>/` folder into folders ready to be dragged into Notion's **Import → Markdown & CSV** dialog or zipped and uploaded via Confluence's **Space settings → Content tools → Import → HTML** tool.
9
+ Utility skill. Wraps the `ba-toolkit publish` CLI subcommand, which converts the markdown artifacts in the current `output/` folder into folders ready to be dragged into Notion's **Import → Markdown & CSV** dialog or zipped and uploaded via Confluence's **Space settings → Content tools → Import → HTML** tool.
10
10
 
11
11
  The conversion happens entirely on disk — **no API calls, no tokens, no network**. The user does the actual upload manually using each tool's native importer.
12
12
 
@@ -20,7 +20,7 @@ This is **not** the same as `/export`. `/export` produces JSON/CSV for issue tra
20
20
 
21
21
  ### 1. Environment detection
22
22
 
23
- The `ba-toolkit publish` subcommand uses the current working directory as the source — no `references/environment.md` lookup needed. Confirm with the user that they are inside their project's `output/<slug>/` folder before running it. If they are not, ask them to `cd output/<slug>` first.
23
+ The `ba-toolkit publish` subcommand uses the current working directory as the source — no `references/environment.md` lookup needed. Confirm with the user that they are inside their project's `output/` folder before running it. If they are not, ask them to `cd output` first.
24
24
 
25
25
  ### 2. Pipeline check
26
26
 
@@ -47,7 +47,7 @@ Map the answer to a `--format` value: `a` → `both`, `b` → `notion`, `c` →
47
47
 
48
48
  ### 4. Execution
49
49
 
50
- Invoke the CLI subcommand via the agent's Bash tool from the project's `output/<slug>/` directory:
50
+ Invoke the CLI subcommand via the agent's Bash tool from the project's `output/` directory:
51
51
 
52
52
  ```bash
53
53
  ba-toolkit publish --format <choice>
@@ -78,7 +78,7 @@ Their closing block ends after the "Available commands" table. Optionally, they
78
78
 
79
79
  ## Rules
80
80
 
81
- - `{file_path}` is the full path where the artifact was saved (typically `output/<slug>/{NN}_{name}_{slug}.md`).
81
+ - `{file_path}` is the full path where the artifact was saved (typically `output/{NN}_{name}_{slug}.md`).
82
82
  - The summary line is generated dynamically — do not repeat boilerplate; mention actual numbers and decisions ("18 FRs across 3 roles, 4 risks captured", not "the artifact was generated").
83
83
  - The "Available commands" table is fixed (5 rows for pipeline skills). Utility skills omit `/done` from the table since they don't have a "finalize" state.
84
84
  - The "Next step" block is built from the lookup table above. Do not hardcode it in individual SKILL.md files.
@@ -33,44 +33,26 @@ Skills should not hardcode paths. They reference this file and apply the detecti
33
33
 
34
34
  ## Output folder structure
35
35
 
36
- **v3.1+ default — per-project subfolder.** `ba-toolkit init` creates `output/<slug>/` and writes the project's `AGENTS.md` inside it. All artifacts for that project also live there:
36
+ `ba-toolkit init` creates `AGENTS.md` at the project root and `output/` for artifacts. One directory = one project.
37
37
 
38
38
  ```
39
39
  repo/
40
- output/
41
- my-app/ ← project A
42
- AGENTS.md
43
- 00_principles_my-app.md
44
- 01_brief_my-app.md
45
- 02_srs_my-app.md
46
- ...
47
- other-project/ ← project B
48
- AGENTS.md
49
- 01_brief_other-project.md
50
- ...
51
- ```
52
-
53
- The user opens their AI agent inside one of those subfolders (`cd output/my-app && claude` or equivalent for the agent of choice). With cwd set to the project subfolder, every skill — including those that look for prior artifacts via `01_brief_*.md` glob — sees only that project's files. Two agent windows in the same repo, each `cd`-ed into a different `output/<slug>/`, work on two completely independent projects with zero cross-talk.
54
-
55
- **Legacy v3.0 single-project layout — still supported.** Projects scaffolded before v3.1 have a single `AGENTS.md` at the repo root and artifacts saved flat under `output/`:
56
-
57
- ```
58
- repo/
59
- AGENTS.md ← legacy single-project
40
+ AGENTS.md
60
41
  output/
61
42
  01_brief_my-app.md
62
43
  02_srs_my-app.md
44
+ 03_stories_my-app.md
63
45
  ...
64
46
  ```
65
47
 
66
- When a skill is run with cwd set to the repo root and finds no `AGENTS.md` next to the artifacts, it walks up the directory tree to find the legacy root `AGENTS.md`. New projects scaffolded with v3.1+ should always use the per-project subfolder layout.
48
+ The user opens their AI agent at the project root. Skills find `AGENTS.md` in the current working directory and save artifacts to `output/`.
67
49
 
68
50
  ## Detection rule for skills
69
51
 
70
52
  When a skill needs to find the project's `AGENTS.md` (for example, to update its `## Pipeline Status` table after generating an artifact):
71
53
 
72
54
  1. Check `cwd/AGENTS.md` first. If present, that's the project's file.
73
- 2. Otherwise walk up the directory tree until you find an `AGENTS.md` (legacy v3.0 fallback).
55
+ 2. If cwd is `output/`, check `../AGENTS.md` (the project root).
74
56
  3. If neither exists, warn the user that the project was likely not scaffolded with `ba-toolkit init` and tell them to run it.
75
57
 
76
- Never create `AGENTS.md` at the repo root from inside a skill — that file is owned by `ba-toolkit init`.
58
+ Never create `AGENTS.md` from inside a skill — that file is owned by `ba-toolkit init`.
@@ -9,7 +9,7 @@
9
9
  **Slug:** [SLUG]
10
10
  **Domain:** [DOMAIN]
11
11
  **Language:** English
12
- **Output folder:** output/[SLUG]/
12
+ **Output folder:** output/
13
13
  <!-- ba-toolkit:end managed -->
14
14
 
15
15
  ## Pipeline Status
@@ -124,7 +124,7 @@ Top architectural decisions from `07a_research_[SLUG].md`. Dev team should read
124
124
  ## 8. Artifact Files Reference
125
125
 
126
126
  ```
127
- output/[SLUG]/
127
+ output/
128
128
  ├── 00_discovery_[SLUG].md
129
129
  ├── 00_principles_[SLUG].md
130
130
  ├── 00_analyze_[SLUG].md