opencastle 1.10.0 → 1.11.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 (69) hide show
  1. package/README.md +29 -15
  2. package/bin/cli.mjs +1 -1
  3. package/dist/cli/detect.d.ts.map +1 -1
  4. package/dist/cli/detect.js +106 -2
  5. package/dist/cli/detect.js.map +1 -1
  6. package/dist/cli/detect.test.js +76 -0
  7. package/dist/cli/detect.test.js.map +1 -1
  8. package/dist/cli/docs-accuracy.test.js +4 -4
  9. package/dist/cli/docs-accuracy.test.js.map +1 -1
  10. package/dist/cli/explain.d.ts.map +1 -1
  11. package/dist/cli/explain.js +7 -0
  12. package/dist/cli/explain.js.map +1 -1
  13. package/dist/cli/init-detect.test.js +18 -0
  14. package/dist/cli/init-detect.test.js.map +1 -1
  15. package/dist/cli/init.d.ts.map +1 -1
  16. package/dist/cli/init.js +1 -0
  17. package/dist/cli/init.js.map +1 -1
  18. package/dist/cli/init.test.js +10 -0
  19. package/dist/cli/init.test.js.map +1 -1
  20. package/dist/cli/mcp-upgrade.test.js +40 -1
  21. package/dist/cli/mcp-upgrade.test.js.map +1 -1
  22. package/dist/cli/mcp.d.ts.map +1 -1
  23. package/dist/cli/mcp.js +6 -2
  24. package/dist/cli/mcp.js.map +1 -1
  25. package/dist/cli/stack-config.d.ts.map +1 -1
  26. package/dist/cli/stack-config.js +14 -1
  27. package/dist/cli/stack-config.js.map +1 -1
  28. package/dist/cli/types.d.ts +3 -1
  29. package/dist/cli/types.d.ts.map +1 -1
  30. package/dist/cli/types.js.map +1 -1
  31. package/dist/cli/update.js +1 -1
  32. package/dist/cli/update.js.map +1 -1
  33. package/dist/orchestrator/plugins/github/config.d.ts +3 -0
  34. package/dist/orchestrator/plugins/github/config.d.ts.map +1 -0
  35. package/dist/orchestrator/plugins/github/config.js +36 -0
  36. package/dist/orchestrator/plugins/github/config.js.map +1 -0
  37. package/dist/orchestrator/plugins/gitlab/config.d.ts +3 -0
  38. package/dist/orchestrator/plugins/gitlab/config.d.ts.map +1 -0
  39. package/dist/orchestrator/plugins/gitlab/config.js +26 -0
  40. package/dist/orchestrator/plugins/gitlab/config.js.map +1 -0
  41. package/dist/orchestrator/plugins/index.d.ts.map +1 -1
  42. package/dist/orchestrator/plugins/index.js +4 -0
  43. package/dist/orchestrator/plugins/index.js.map +1 -1
  44. package/dist/orchestrator/plugins/types.d.ts +15 -1
  45. package/dist/orchestrator/plugins/types.d.ts.map +1 -1
  46. package/package.json +2 -2
  47. package/src/cli/detect.test.ts +88 -0
  48. package/src/cli/detect.ts +100 -3
  49. package/src/cli/docs-accuracy.test.ts +4 -4
  50. package/src/cli/explain.ts +6 -0
  51. package/src/cli/init-detect.test.ts +22 -0
  52. package/src/cli/init.test.ts +13 -0
  53. package/src/cli/init.ts +1 -0
  54. package/src/cli/mcp-upgrade.test.ts +45 -2
  55. package/src/cli/mcp.ts +10 -4
  56. package/src/cli/stack-config.ts +18 -1
  57. package/src/cli/types.ts +3 -1
  58. package/src/cli/update.ts +1 -1
  59. package/src/orchestrator/customizations/agents/skill-matrix.json +7 -1
  60. package/src/orchestrator/plugins/github/config.ts +37 -0
  61. package/src/orchestrator/plugins/github/mcp.json +9 -0
  62. package/src/orchestrator/plugins/github/plugin.json +24 -0
  63. package/src/orchestrator/plugins/github/skills/github-platform/SKILL.md +77 -0
  64. package/src/orchestrator/plugins/gitlab/config.ts +27 -0
  65. package/src/orchestrator/plugins/gitlab/mcp.json +9 -0
  66. package/src/orchestrator/plugins/gitlab/plugin.json +21 -0
  67. package/src/orchestrator/plugins/gitlab/skills/gitlab-platform/SKILL.md +72 -0
  68. package/src/orchestrator/plugins/index.ts +4 -0
  69. package/src/orchestrator/plugins/types.ts +17 -1
package/src/cli/update.ts CHANGED
@@ -403,7 +403,7 @@ export default async function update({
403
403
  value: p.id,
404
404
  selected: oldStack
405
405
  ? currentTeam.has(p.id as TeamTool)
406
- : isPreselected(p, repoInfo),
406
+ : isPreselected(p, repoInfo) || detectedTools.has(p.id),
407
407
  }))
408
408
  )
409
409
 
@@ -79,6 +79,10 @@
79
79
  "notifications": {
80
80
  "entries": [],
81
81
  "description": "Team messaging, alerts, bot integrations, channel management"
82
+ },
83
+ "source-control": {
84
+ "entries": [],
85
+ "description": "Pull and merge requests, code review, repository issues, CI status"
82
86
  }
83
87
  },
84
88
  "agents": {
@@ -180,6 +184,7 @@
180
184
  "slots": [
181
185
  "deployment",
182
186
  "observability",
187
+ "source-control",
183
188
  "codebase-tool"
184
189
  ],
185
190
  "directSkills": [
@@ -198,7 +203,8 @@
198
203
  "Team Lead (OpenCastle)": {
199
204
  "slots": [
200
205
  "task-management",
201
- "knowledge-management"
206
+ "knowledge-management",
207
+ "source-control"
202
208
  ],
203
209
  "directSkills": [
204
210
  "validation-gates",
@@ -0,0 +1,37 @@
1
+ import type { PluginConfig } from '../types.js';
2
+
3
+ export const config: PluginConfig = {
4
+ id: 'github',
5
+ name: 'GitHub',
6
+ category: 'team',
7
+ subCategory: 'source-control',
8
+ label: 'GitHub',
9
+ hint: 'Pull requests, reviews, CI and stacked PRs via GitHub\'s MCP server',
10
+ skillName: 'github-platform',
11
+ mcpServerKey: 'GitHub',
12
+ // GitHub's own remote server. VS Code signs in to it with OAuth; GitHub
13
+ // supports no other client's OAuth, so every other target sends a token.
14
+ mcpConfig: {
15
+ type: 'http',
16
+ url: 'https://api.githubcopilot.com/mcp/',
17
+ },
18
+ tokenAuth: {
19
+ oauthTargets: ['vscode'],
20
+ headers: { Authorization: 'Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}' },
21
+ },
22
+ authType: 'env-token',
23
+ envVars: [
24
+ {
25
+ name: 'GITHUB_PERSONAL_ACCESS_TOKEN',
26
+ hint: 'Create at github.com → Settings → Developer settings → Personal access tokens (VS Code signs in with OAuth instead)',
27
+ },
28
+ ],
29
+ // The whole server: GitHub adds and renames tools between releases, and a
30
+ // named tool that does not exist is silently absent.
31
+ agentToolMap: {
32
+ 'team-lead': ['GitHub/*'],
33
+ 'devops-expert': ['GitHub/*'],
34
+ },
35
+ docsUrl: 'https://www.opencastle.dev/docs/plugins#github',
36
+ officialDocs: 'https://github.com/github/github-mcp-server',
37
+ };
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
3
+ "mcpServers": {
4
+ "GitHub": {
5
+ "type": "streamable-http",
6
+ "url": "https://api.githubcopilot.com/mcp/"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
+ "name": "github",
4
+ "description": "GitHub skill and MCP server for AI coding assistants: Pull requests, reviews, CI and stacked PRs via GitHub's MCP server.",
5
+ "homepage": "https://www.opencastle.dev/docs/plugins#github",
6
+ "repository": "https://github.com/monkilabs/opencastle",
7
+ "license": "MIT",
8
+ "keywords": [
9
+ "team",
10
+ "source-control"
11
+ ],
12
+ "extensions": {
13
+ "dev.opencastle": {
14
+ "label": "GitHub",
15
+ "category": "team",
16
+ "subCategory": "source-control",
17
+ "authType": "env-token",
18
+ "env": [
19
+ "GITHUB_PERSONAL_ACCESS_TOKEN"
20
+ ],
21
+ "officialDocs": "https://github.com/github/github-mcp-server"
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: github-platform
3
+ description: "GitHub pull requests, review threads, failing Actions checks and stacked pull requests, through GitHub's MCP server and the gh CLI. Use when opening, reviewing or updating a pull request, fixing a failed check, or splitting a change into a stack."
4
+ ---
5
+
6
+ # GitHub Platform
7
+
8
+ Branch, commit and pull request conventions: the **git-workflow** skill. Docs: https://docs.github.com/en/pull-requests
9
+
10
+ ## The MCP server
11
+
12
+ GitHub's own remote server, `https://api.githubcopilot.com/mcp/`. VS Code signs in with OAuth. Every other assistant sends `GITHUB_PERSONAL_ACCESS_TOKEN`, so the server acts as that token's user — call `get_me` first to know whose name every comment will carry. Tool names change between releases: read the tool list the server offers instead of assuming a name.
13
+
14
+ - **Toolsets.** On by default: `context`, `repos`, `issues`, `pull_requests`, `users`. An `X-MCP-Toolsets` header on the server entry turns on more (`actions` for CI logs), and `X-MCP-Readonly: true` drops every write tool.
15
+ - **Token.** Fine-grained and limited to the repositories the agents work in: **Contents**, **Pull requests** and **Issues** read and write, **Metadata** and **Actions** read. A 404 on a repository you know exists is the token: its repository list, or an organization that has not approved it.
16
+ - **`gh` covers the rest:** review threads, job logs and stacks, below. It signs in on its own (`gh auth status`).
17
+
18
+ ## Gotchas
19
+
20
+ - **A review is pending until submitted.** Comments added to a pending review are invisible to everyone else, and a session that ends before the submit leaves them unsent.
21
+ - **Why a PR cannot merge:** `gh pr view 42 --json mergeStateStatus`. `BEHIND` needs a rebase onto its base, `DIRTY` has conflicts, `BLOCKED` lacks a required review or check, `UNSTABLE` has a non-required check failing.
22
+ - **A person merges**, as git-workflow says. Stop at a reviewed PR with green checks, though both the server and `gh` offer a merge.
23
+ - Open a draft while work remains (`gh pr create --draft`) and mark it ready when it is done (`gh pr ready 42`). `Closes #123` in the body closes the issue only when the PR merges into the default branch.
24
+ - In a review comment, a ```` ```suggestion ```` block replaces the commented lines when the author applies it. Use it for any fix that fits those lines.
25
+ - Search allows 30 requests a minute. Narrow with `repo:` and `is:open` rather than paging.
26
+
27
+ ## Review threads
28
+
29
+ The REST API returns review comments without saying which are resolved. GraphQL says.
30
+
31
+ 1. List the threads:
32
+
33
+ ```sh
34
+ gh api graphql -F owner='{owner}' -F repo='{repo}' -F pr=42 -f query='
35
+ query($owner: String!, $repo: String!, $pr: Int!) {
36
+ repository(owner: $owner, name: $repo) { pullRequest(number: $pr) {
37
+ reviewThreads(first: 100) { nodes { id isResolved isOutdated path line
38
+ comments(first: 20) { nodes { databaseId author { login } body } } } } } } }'
39
+ ```
40
+
41
+ 2. Fix what each unresolved thread asks, then commit and push. An `isOutdated` thread sits on code that has since changed: check that its point still applies.
42
+ 3. Reply in the thread with what changed: `gh api repos/{owner}/{repo}/pulls/42/comments/<databaseId>/replies -f body='Fixed in <sha>: …'`
43
+ 4. Resolve it: `gh api graphql -F id=<thread id> -f query='mutation($id: ID!) { resolveReviewThread(input: {threadId: $id}) { thread { isResolved } } }'`
44
+
45
+ Done when step 1 shows every thread you fixed as resolved. A point you disagree with gets a reply and stays open for the reviewer.
46
+
47
+ ## Failing checks
48
+
49
+ 1. `gh pr checks 42` lists every check on the head commit. `--watch --fail-fast` waits, and stops at the first failure.
50
+ 2. Read the failure with `gh run view <run-id> --log-failed`, which prints only the failed steps (the run ID is in the check's link). Start at the first error, not the last line.
51
+ 3. Reproduce it with the command the step ran, fix it, and push. Done when `gh pr checks 42` passes on the new head commit.
52
+ 4. If your diff cannot explain the failure, run `gh run rerun <run-id> --failed` once. A second failure is real.
53
+
54
+ Causes no log names:
55
+
56
+ - A push made with `GITHUB_TOKEN` inside a workflow starts no other workflow, so a bot's commit gets no checks. Push with a GitHub App token or a personal token when it needs them.
57
+ - A required check whose workflow is skipped by a `paths` filter never reports, and the PR waits for it forever. Run the job and exit early instead.
58
+ - A PR from a fork runs `pull_request` workflows with a read-only token and no secrets. `pull_request_target` has both and runs the base branch's workflow, so checking out the PR's code there runs it with your secrets.
59
+ - Set `permissions:` on each workflow rather than inheriting the repository default, which is read and write on older repositories.
60
+
61
+ ## Stacked pull requests
62
+
63
+ A change too big for one review becomes a stack: a chain of layers, each its own PR on the branch below, with the bottom one on trunk (the default branch). Dependencies point down: shared types and schema at the bottom, the code that uses them above. Each PR is held to trunk's required reviews and checks, so every layer builds and passes CI on its own. With agents, one task per layer.
64
+
65
+ The `gh stack` extension does the bookkeeping: `gh extension install github/gh-stack`. Name every branch on the command line, because a bare command opens a prompt.
66
+
67
+ 1. `gh stack init feat/search-01-schema`, then commit the first layer.
68
+ 2. For each next layer, from the top one: `gh stack add feat/search-02-api`, then commit.
69
+ 3. `gh stack push`, then `gh stack submit --auto`. This opens one draft PR per branch, each based on the one below, linked as a stack. Give each its title and body with `gh pr edit <n> --title "…" --body-file <file>`. Done when `gh stack view --json` lists every branch with its PR.
70
+ 4. To change a lower layer: `gh stack checkout feat/search-01-schema`, commit, then `gh stack rebase --upstack`, `gh stack push` and `gh stack top`.
71
+ 5. After a layer merges, `gh stack sync --prune` rebases what remains onto trunk, pushes, and deletes the merged branches.
72
+
73
+ - Merges go bottom up, and a person does them. Merging a PR merges every layer below it.
74
+ - History stays linear. Rebase rather than merging trunk into a layer, and push with `gh stack push`, which uses `--force-with-lease` per branch.
75
+ - A stack lives in one repository; it cannot span forks.
76
+ - Exit code 3 is a rebase conflict: resolve it, `git add`, then `gh stack rebase --continue`, or `--abort` to restore every branch.
77
+ - Exit code 9 means stacks are not enabled for this repository. Open each PR by hand with `gh pr create --draft --base <branch below>`. After a layer is squash-merged, rebase the next one with `git rebase --onto origin/main <merged branch> <next branch>` so the squashed commits are not replayed.
@@ -0,0 +1,27 @@
1
+ import type { PluginConfig } from '../types.js';
2
+
3
+ export const config: PluginConfig = {
4
+ id: 'gitlab',
5
+ name: 'GitLab',
6
+ category: 'team',
7
+ subCategory: 'source-control',
8
+ label: 'GitLab',
9
+ hint: 'Merge requests, pipelines and stacked MRs via GitLab\'s MCP server',
10
+ skillName: 'gitlab-platform',
11
+ mcpServerKey: 'GitLab',
12
+ // GitLab's own server, signed in with OAuth — it registers each client
13
+ // itself, so no token in .env. A self-managed instance serves the same
14
+ // path on its own host; edit the URL, and `sync` leaves the entry alone.
15
+ mcpConfig: {
16
+ type: 'http',
17
+ url: 'https://gitlab.com/api/v4/mcp',
18
+ },
19
+ authType: 'oauth',
20
+ envVars: [],
21
+ agentToolMap: {
22
+ 'team-lead': ['GitLab/*'],
23
+ 'devops-expert': ['GitLab/*'],
24
+ },
25
+ docsUrl: 'https://www.opencastle.dev/docs/plugins#gitlab',
26
+ officialDocs: 'https://docs.gitlab.com/user/model_context_protocol/mcp_server/',
27
+ };
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
3
+ "mcpServers": {
4
+ "GitLab": {
5
+ "type": "streamable-http",
6
+ "url": "https://gitlab.com/api/v4/mcp"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
+ "name": "gitlab",
4
+ "description": "GitLab skill and MCP server for AI coding assistants: Merge requests, pipelines and stacked MRs via GitLab's MCP server.",
5
+ "homepage": "https://www.opencastle.dev/docs/plugins#gitlab",
6
+ "repository": "https://github.com/monkilabs/opencastle",
7
+ "license": "MIT",
8
+ "keywords": [
9
+ "team",
10
+ "source-control"
11
+ ],
12
+ "extensions": {
13
+ "dev.opencastle": {
14
+ "label": "GitLab",
15
+ "category": "team",
16
+ "subCategory": "source-control",
17
+ "authType": "oauth",
18
+ "officialDocs": "https://docs.gitlab.com/user/model_context_protocol/mcp_server/"
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: gitlab-platform
3
+ description: "GitLab merge requests, review threads, failed pipelines and stacked merge requests, through GitLab's MCP server and the glab CLI. Use when opening, reviewing or updating a merge request, fixing a failed pipeline, or splitting a change into a stack."
4
+ ---
5
+
6
+ # GitLab Platform
7
+
8
+ Branch, commit and merge request conventions: the **git-workflow** skill, where a pull request is GitLab's merge request (MR). Docs: https://docs.gitlab.com/user/project/merge_requests/
9
+
10
+ ## The MCP server
11
+
12
+ GitLab's own server, `https://gitlab.com/api/v4/mcp`, or `https://<your-host>/api/v4/mcp` on a self-managed instance (18.6 or later). It signs in with OAuth: the assistant registers itself and opens a browser the first time. It answers only once MCP access is allowed, by an owner for the top-level group on GitLab.com or by an administrator on a self-managed instance. Tool names change between releases: read the tool list the server offers instead of assuming a name.
13
+
14
+ - **Toolsets.** On by default: `meta`, `core`, `merge_requests`, `work_items`, `repository`, `ci`. `wikis` and `code_security` are opt-in, through the `X-Gitlab-Enabled-Mcp-Server-Toolsets` header.
15
+ - **Identifiers.** A project is its full path (`group/subgroup/project`) or its numeric ID. An MR is `!42` and an issue `#42`. Tools take that **IID** with the project, not the global ID the API also returns.
16
+ - **One call, many facets.** `get_merge_request` takes `include` (`diffs`, `pipelines`, `discussions`, `approvals`, `conflicts`), and `get_pipeline` takes `include: ["jobs"]`. Issues, tasks and epics are all work items (`save_work_item`, `get_work_item`); `create_issue` and `get_issue` still answer but are superseded.
17
+ - **`glab` covers the rest:** raw API calls, CI linting and stacks, below. It signs in on its own (`glab auth status`).
18
+
19
+ ## Gotchas
20
+
21
+ - **A line that starts with a quick action runs it.** `/merge`, `/approve`, `/close` or `/assign` at the start of a line in a comment or description executes on save, through the API too. Wrap a command you are only quoting in backticks.
22
+ - **Why an MR cannot merge:** `glab api projects/:id/merge_requests/42` and read `detailed_merge_status`: `not_approved`, `discussions_not_resolved`, `ci_must_pass`, `need_rebase`, `conflict` or `draft_status`.
23
+ - **A person merges**, as git-workflow says. Stop at an approved MR with a green pipeline, though `accept_merge_request` exists.
24
+ - `Draft:` at the start of the title keeps an MR from merging while work remains. `Closes #42` in the description closes the issue only when the MR merges into the default branch.
25
+ - **An error on a field can be the tier.** `weight`, `status_id`, `blocks` links and MR dependencies need Premium; `health_status` and vulnerabilities need Ultimate. On Free, leave them out rather than retrying.
26
+ - In a review comment, a ```` ```suggestion:-0+0 ```` block replaces the commented line when the author applies it; `-1+2` widens it to one line above and two below.
27
+
28
+ ## Review threads
29
+
30
+ 1. List the discussions: `get_merge_request` with `include: ["discussions"]`, or `glab api projects/:id/merge_requests/42/discussions`. Each discussion has an `id` and its notes, and a resolvable note carries `resolved`.
31
+ 2. Fix what each unresolved discussion asks, then commit and push.
32
+ 3. Reply in the discussion with what changed: `save_note` with its ID, or `glab api projects/:id/merge_requests/42/discussions/<id>/notes -f body='Fixed in <sha>: …'`.
33
+ 4. Resolve it with `save_merge_request_review`, or `glab api -X PUT projects/:id/merge_requests/42/discussions/<id> -F resolved=true`.
34
+
35
+ Done when step 1 shows every discussion you fixed as resolved. A point you disagree with gets a reply and stays open for the reviewer; a project that requires every thread resolved will not merge until they are.
36
+
37
+ ## Failing pipelines
38
+
39
+ 1. Find the pipeline for the MR's latest commit: `get_merge_request` with `include: ["pipelines"]`, then `get_pipeline` with `include: ["jobs"]` for the failed jobs. In a terminal, `glab ci status` shows the current branch's pipeline.
40
+ 2. Read the failure with `get_job` and its log, or `glab ci trace <job-id>`. Start at the first error, not the last line.
41
+ 3. Reproduce it with the command the job ran, fix it, and push. Done when the pipeline for the new head commit passes.
42
+ 4. If your diff cannot explain the failure, retry the job once (`save_pipeline`, or `glab ci retry <job-id>`). A second failure is real.
43
+
44
+ Causes no log names:
45
+
46
+ - Protected variables reach only protected branches and tags, so a job that needs one fails on every MR branch.
47
+ - Once jobs run in merge request pipelines, a push to a branch with an open MR starts two pipelines, branch and MR, unless `workflow:rules` picks one:
48
+
49
+ ```yaml
50
+ workflow:
51
+ rules:
52
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
53
+ - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
54
+ when: never
55
+ - if: $CI_COMMIT_BRANCH
56
+ ```
57
+
58
+ - A job cannot mix `rules` with `only` or `except`. `glab ci lint` checks `.gitlab-ci.yml` against the instance before you push.
59
+
60
+ ## Stacked merge requests
61
+
62
+ A change too big for one review becomes a stack: a chain of layers, each its own MR targeting the branch below, with the bottom one on trunk (the default branch). Dependencies point down: shared types and schema at the bottom, the code that uses them above. Every layer passes its pipeline on its own. With agents, one task per layer. When an MR merges, GitLab retargets up to four MRs that targeted its branch onto its target, and from GitLab 16.9 it rebases them too.
63
+
64
+ 1. Branch each layer from the one below (`feat/search-01-schema`, `feat/search-02-api`, …), commit, and push every branch.
65
+ 2. Open the MRs bottom up, each on the branch below: `glab mr create --source-branch feat/search-02-api --target-branch feat/search-01-schema --draft --fill`, or `save_merge_request`. On Premium, also list the lower MR under **Merge request dependencies**, so the upper one cannot merge first. Done when every layer has an MR targeting the branch below it.
66
+ 3. To change a lower layer, add a commit there; an amend rewrites what the layers above are built on. Then, from the top branch, `git rebase --update-refs feat/search-01-schema` replays every layer above and moves their branches. Push them all with `git push --force-with-lease origin <branch> <branch>…`. Done when `git log --oneline --graph` from the top branch is one straight line through every layer.
67
+ 4. After a layer merges, GitLab retargets the next one. If it was squash-merged on an instance older than 16.9, rebase the next layer yourself: `git rebase --onto origin/main feat/search-01-schema feat/search-02-api`.
68
+
69
+ - Merges go bottom up, and a person does them. An upper MR merged first lands in the branch below, not in trunk.
70
+ - History stays linear. Rebase rather than merging trunk into a layer.
71
+ - MRs from forks are not retargeted.
72
+ - `glab stack` (GitLab CLI 1.42 or later, experimental) automates the chain. `glab stack create <name>` starts it, `glab stack save -m "<description>"` adds each layer, `glab stack amend` changes the one checked out, and `glab stack sync` pushes every branch and creates or updates the chained MRs.
@@ -12,6 +12,8 @@ import { config as linear } from './linear/config.js';
12
12
  import { config as jira } from './jira/config.js';
13
13
  import { config as slack } from './slack/config.js';
14
14
  import { config as teams } from './teams/config.js';
15
+ import { config as github } from './github/config.js';
16
+ import { config as gitlab } from './gitlab/config.js';
15
17
  import { config as chromeDevtools } from './chrome-devtools/config.js';
16
18
  import { config as netlify } from './netlify/config.js';
17
19
  import { config as turborepo } from './turborepo/config.js';
@@ -66,6 +68,8 @@ export const PLUGINS: Record<string, PluginConfig> = {
66
68
  notion,
67
69
  slack,
68
70
  teams,
71
+ github,
72
+ gitlab,
69
73
  };
70
74
 
71
75
  /** Tech tool plugins only. */
@@ -1,3 +1,5 @@
1
+ import type { IdeChoice } from '../../cli/types.js';
2
+
1
3
  /**
2
4
  * Configuration for a tool plugin.
3
5
  * Single source of truth for tool metadata used by init, adapters, and agents.
@@ -13,7 +15,7 @@ export interface PluginConfig {
13
15
  category: 'tech' | 'team';
14
16
 
15
17
  /** Sub-category for grouping */
16
- subCategory: 'cms' | 'database' | 'deployment' | 'framework' | 'codebase-tool' | 'task-management' | 'knowledge-management' | 'notifications' | 'testing' | 'e2e-testing' | 'design' | 'email' | 'payments' | 'observability';
18
+ subCategory: 'cms' | 'database' | 'deployment' | 'framework' | 'codebase-tool' | 'task-management' | 'knowledge-management' | 'notifications' | 'source-control' | 'testing' | 'e2e-testing' | 'design' | 'email' | 'payments' | 'observability';
17
19
 
18
20
  /** Label shown in the `npx opencastle init` multiselect */
19
21
  label: string;
@@ -55,6 +57,20 @@ export interface PluginConfig {
55
57
  /** VS Code input prompts required by this plugin's MCP config (e.g. tenant ID) */
56
58
  mcpInputs?: McpInput[];
57
59
 
60
+ /**
61
+ * For a remote server that only some clients can sign in to with OAuth.
62
+ *
63
+ * GitHub's completes OAuth in VS Code and in no other target: Claude Code,
64
+ * Cursor, Windsurf, OpenCode and Codex must send a personal access token. The
65
+ * targets in `oauthTargets` get `mcpConfig` alone and need no token; every
66
+ * other target also sends `headers`, each value a `${NAME}` reference to one
67
+ * of `envVars`, written in that target's own spelling.
68
+ */
69
+ tokenAuth?: {
70
+ oauthTargets: IdeChoice[];
71
+ headers: Record<string, string>;
72
+ };
73
+
58
74
  /**
59
75
  * What earlier releases generated for this server, newest first.
60
76
  *