bmad-stella 2.0.0 → 2.0.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 +3 -1
- package/bmad-core/agents/planner.md +1 -1
- package/docs/atlassian-token-guide.md +44 -0
- package/docs/bmad-memory.md +38 -0
- package/docs/stella-user-guide.md +87 -50
- package/package.json +117 -117
- package/tools/installer/lib/claude-permissions-manager.js +4 -5
- package/tools/installer/lib/dependency-manager.js +145 -511
- package/bmad-core/utils/github-mcp-auth.js +0 -81
- package/docs/github-pat-guide.md +0 -65
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* github-mcp-auth.js — dynamic auth header provider for the GitHub MCP server.
|
|
5
|
-
*
|
|
6
|
-
* Claude Code runs this as a server's `headersHelper` on every connection. It must
|
|
7
|
-
* print a JSON object of header name→value pairs to stdout and nothing else
|
|
8
|
-
* (Claude parses stdout as JSON). The GitHub remote MCP server authenticates with a
|
|
9
|
-
* Personal Access Token sent as `Authorization: Bearer <token>`.
|
|
10
|
-
*
|
|
11
|
-
* The token is read from (in order):
|
|
12
|
-
* 1. process.env.GITHUB_PERSONAL_ACCESS_TOKEN (if exported in the environment)
|
|
13
|
-
* 2. GITHUB_PERSONAL_ACCESS_TOKEN in <projectRoot>/.env (git-ignored, mode 0600)
|
|
14
|
-
*
|
|
15
|
-
* <projectRoot> is resolved from this file's location: the helper is installed at
|
|
16
|
-
* <projectRoot>/.bmad-core/utils/github-mcp-auth.js, so the root is two levels up.
|
|
17
|
-
*
|
|
18
|
-
* On success: writes {"Authorization":"Bearer <token>"} to stdout, exits 0.
|
|
19
|
-
* On failure: writes a diagnostic to stderr, exits 1 (Claude marks the connection
|
|
20
|
-
* as needing authentication rather than sending an empty header).
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const fs = require('node:fs');
|
|
24
|
-
const path = require('node:path');
|
|
25
|
-
|
|
26
|
-
const TOKEN_KEY = 'GITHUB_PERSONAL_ACCESS_TOKEN';
|
|
27
|
-
|
|
28
|
-
/** Read a single key from a .env file without pulling in a dotenv dependency. */
|
|
29
|
-
function readEnvFileValue(envPath, key) {
|
|
30
|
-
let contents;
|
|
31
|
-
try {
|
|
32
|
-
contents = fs.readFileSync(envPath, 'utf8');
|
|
33
|
-
} catch {
|
|
34
|
-
return null; // file missing/unreadable — caller handles
|
|
35
|
-
}
|
|
36
|
-
for (const rawLine of contents.split(/\r?\n/)) {
|
|
37
|
-
const line = rawLine.trim();
|
|
38
|
-
if (!line || line.startsWith('#')) continue;
|
|
39
|
-
const eq = line.indexOf('=');
|
|
40
|
-
if (eq === -1) continue;
|
|
41
|
-
if (line.slice(0, eq).trim() !== key) continue;
|
|
42
|
-
let value = line.slice(eq + 1).trim();
|
|
43
|
-
if (
|
|
44
|
-
(value.startsWith('"') && value.endsWith('"')) ||
|
|
45
|
-
(value.startsWith("'") && value.endsWith("'"))
|
|
46
|
-
) {
|
|
47
|
-
value = value.slice(1, -1);
|
|
48
|
-
}
|
|
49
|
-
return value;
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function resolveToken() {
|
|
55
|
-
const fromEnv = process.env[TOKEN_KEY];
|
|
56
|
-
if (fromEnv && fromEnv.trim()) return { token: fromEnv.trim(), source: 'environment' };
|
|
57
|
-
|
|
58
|
-
// <root>/.bmad-core/utils/github-mcp-auth.js → <root>
|
|
59
|
-
const projectRoot = path.resolve(__dirname, '..', '..');
|
|
60
|
-
// Tokens live in <root>/bmad-docs/.bmad-tokens/.env (kept in sync with the installer).
|
|
61
|
-
const envPath = path.join(projectRoot, 'bmad-docs', '.bmad-tokens', '.env');
|
|
62
|
-
const fromFile = readEnvFileValue(envPath, TOKEN_KEY);
|
|
63
|
-
if (fromFile && fromFile.trim()) return { token: fromFile.trim(), source: envPath };
|
|
64
|
-
|
|
65
|
-
return { token: null, source: envPath };
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function main() {
|
|
69
|
-
const { token, source } = resolveToken();
|
|
70
|
-
if (!token) {
|
|
71
|
-
process.stderr.write(
|
|
72
|
-
`github-mcp-auth: ${TOKEN_KEY} not found in the environment or ${source}.\n` +
|
|
73
|
-
`Add it to .env or run the BMad-Stella installer to (re)configure the GitHub MCP server.\n`,
|
|
74
|
-
);
|
|
75
|
-
process.exit(1);
|
|
76
|
-
}
|
|
77
|
-
// ONLY the JSON object goes to stdout.
|
|
78
|
-
process.stdout.write(JSON.stringify({ Authorization: `Bearer ${token}` }));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
main();
|
package/docs/github-pat-guide.md
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Create a GitHub Token for BMad (GitHub MCP)
|
|
2
|
-
|
|
3
|
-
The GitHub MCP server (used by the PR-reviewer) authenticates with a **fine-grained Personal Access Token**. This guide walks you through creating one.
|
|
4
|
-
|
|
5
|
-
**⏱️ ~2 minutes. The token is read-only — it cannot change your code.**
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 1. Open the token page
|
|
10
|
-
|
|
11
|
-
1. Go to → **https://github.com/settings/personal-access-tokens**
|
|
12
|
-
2. Click **Fine-grained tokens**
|
|
13
|
-
3. Click **Generate new token**
|
|
14
|
-
|
|
15
|
-
_(full path: GitHub → your avatar → **Settings** → **Developer settings** → **Personal access tokens** → **Fine-grained tokens** → **Generate new token**)_
|
|
16
|
-
|
|
17
|
-
## 2. Name + expiry
|
|
18
|
-
|
|
19
|
-
- **Token name:** `<your preferred name>` (e.g. `bmad-github-mcp`)
|
|
20
|
-
- **Expiration:** 90 days (pick what you like)
|
|
21
|
-
|
|
22
|
-
## 3. Resource owner
|
|
23
|
-
|
|
24
|
-
Pick whoever **owns the repo** you'll review:
|
|
25
|
-
|
|
26
|
-
- If the repo is under **your personal account**, select **yourself**.
|
|
27
|
-
- If the repo is under an **organization** you have access to, select that **organization**.
|
|
28
|
-
|
|
29
|
-
## 4. Repository access
|
|
30
|
-
|
|
31
|
-
Choose **"Only select repositories"** → pick the repo(s) you'll do PR reviews in.
|
|
32
|
-
|
|
33
|
-
## 5. Permissions → Repository permissions (the important part)
|
|
34
|
-
|
|
35
|
-
Set exactly these two to **Read-only**:
|
|
36
|
-
|
|
37
|
-
| Permission | Set to |
|
|
38
|
-
| ----------------- | --------- |
|
|
39
|
-
| **Contents** | Read-only |
|
|
40
|
-
| **Pull requests** | Read-only |
|
|
41
|
-
|
|
42
|
-
_("Metadata: Read" turns on by itself — leave it. Everything else: "No access".)_
|
|
43
|
-
|
|
44
|
-
> ⚠️ **Don't skip Contents: Read.** Without it, PR review fails with a **403** when fetching the diff (metadata works, the diff doesn't).
|
|
45
|
-
|
|
46
|
-
## 6. Generate + copy
|
|
47
|
-
|
|
48
|
-
Click **Generate token** → **copy it now** (GitHub shows it only once). It starts with `github_pat_…`.
|
|
49
|
-
|
|
50
|
-
## 7. Give it to BMad
|
|
51
|
-
|
|
52
|
-
- **During install:** paste it when the installer asks for the **GitHub Personal Access Token**.
|
|
53
|
-
- **Already installed, or changing the token later:** open `bmad-docs/.bmad-tokens/.env` in your project and paste your token there:
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
GITHUB_PERSONAL_ACCESS_TOKEN=github_pat_xxxxxxxx
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## ✅ Done
|
|
60
|
-
|
|
61
|
-
In Claude Code: `/mcp` → GitHub should show **connected**.
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
**Security note:** the token is stored in a git-ignored file (`bmad-docs/.bmad-tokens/.env`) and is read-only — it can't push, merge, or modify anything. Rotate it by editing that file.
|