Skip to content

feat: migrate open-brain plugin to ai-brain repo#16

Merged
flippyhead merged 18 commits into
mainfrom
feat/ai-brain-plugin-migration
Apr 20, 2026
Merged

feat: migrate open-brain plugin to ai-brain repo#16
flippyhead merged 18 commits into
mainfrom
feat/ai-brain-plugin-migration

Conversation

@flippyhead
Copy link
Copy Markdown
Owner

@flippyhead flippyhead commented Apr 20, 2026

Summary

Migrates the open-brain plugin out of flippyhead/radar into this repo, renamed to ai-brain, upgraded for the v3 server (hybrid search, progressive disclosure, timeline, citations). Publishes to flippyhead/ai-brain-plugin via CI mirror on version tag push.

Spec

docs/superpowers/specs/2026-04-20-ai-brain-plugin-migration-design.md

What's in this PR

  • Plugin source at plugins/ai-brain/ — 3 upgraded skills + 2 new skills + hook
  • Repo-root marketplace.json for dev installs
  • Skill->tool drift check in CI
  • publish-plugin workflow for tag-triggered distribution mirror
  • Distribution marketplace.json generator

Test Plan

  • Drift-check workflow runs green on this PR
  • After merge: tag v3.0.0-rc.1 and verify publish workflow succeeds and populates flippyhead/ai-brain-plugin

🤖 Generated with Claude Code


Note

Medium Risk
Adds a new Claude Code plugin plus GitHub Actions that publish to an external distribution repo via SSH deploy key; mistakes could break releases or push incorrect contents/tags. No server-side logic changes, but CI automation and install surface area are significant.

Overview
Introduces a new ai-brain Claude Code plugin (v3.0.0) in plugins/ai-brain/, including a SessionStart hook (check-brain-status.mjs) and five skills (migrated brain-init, brain-sync, weekly-review plus new brain-thread and brain-context) updated to use progressive disclosure (search_thoughts index + get_thoughts hydration), timeline_thoughts, and explicit thought:<id>/insight:<id>/list:<id> citation requirements.

Adds plugin packaging + automation: a repo-root .claude-plugin/marketplace.json for dev installs, a script to generate a flat distribution marketplace.json from plugins/ai-brain/.claude-plugin/plugin.json, a CI drift-check that verifies skill/hook tool references match MCP_TOOL_NAMES, and a tag-triggered publish-plugin workflow that mirrors the plugin into flippyhead/ai-brain-plugin (with tag/branch handling and safety checks).

Reviewed by Cursor Bugbot for commit cf43130. Bugbot is set up for automated code reviews on this repo. Configure here.

flippyhead and others added 18 commits April 20, 2026 10:22
Design for migrating the open-brain Claude Code plugin out of
flippyhead/radar into this repo, renaming to ai-brain, upgrading
skills for v3 server capabilities (hybrid search, progressive
disclosure, timeline, citations), and publishing via a thin
distribution repo (flippyhead/ai-brain-plugin) mirrored by CI.

Co-Authored-By: Claude <noreply@anthropic.com>
21 tasks across 4 phases: migrate plugin from radar to ai-brain,
upgrade three existing skills (brain-init, brain-sync, weekly-review)
for v3 server shape + citations, add two new skills (brain-thread,
brain-context) leveraging timeline_thoughts, publish via CI mirror to
flippyhead/ai-brain-plugin. Includes skill->tool drift check script
+ workflow to prevent server/plugin drift.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Renamed env var prefixes OPEN_BRAIN_* to AI_BRAIN_*. Updated nudge
text to mention the new brain-thread and brain-context skills.
clientInfo now identifies as ai-brain-hook v3.0.0.

Co-Authored-By: Claude <noreply@anthropic.com>
Renamed all 'Open Brain' references to 'AI Brain'. Added note about
new compact-index return shape of search_thoughts and how to use
get_thoughts to confirm duplicate candidates. Report step now
cites each captured thought as thought:<id> and suggests the two
new navigation skills.

Co-Authored-By: Claude <noreply@anthropic.com>
Step 3 reworked into 3a/3b/3c: triage via compact search_thoughts
index, select up to 5 hydration candidates, fetch full content via
get_thoughts. Diff now operates on hydrated docs only. Report cites
each captured thought and each unchanged prior thought as
thought:<id>.

Co-Authored-By: Claude <noreply@anthropic.com>
Step 2 replaces ad-hoc recent-thought fetching with an explicit
timeline_thoughts(aroundMs=weekStartMs, before=0, after=50) call.
Step 4 hydrates up to 10 noteworthy thoughts via get_thoughts before
the synthesis. Every section of the output now requires citations —
thought:<id>, insight:<id>, list:<id>. The saved summary itself
includes the grounding citations so future reviews can trace back.

Co-Authored-By: Claude <noreply@anthropic.com>
New skill walks timeline_thoughts around a seed (topic or thought ID),
hydrates 3-5 substantive neighbors via get_thoughts, and produces a
citable markdown narrative. Enforces thought:<id> citations for every
claim in the output.

Co-Authored-By: Claude <noreply@anthropic.com>
New skill resolves a time reference (date, range, or event-like phrase
resolved via search_thoughts), pulls a timeline window via
timeline_thoughts, hydrates 5-8 diverse thoughts via get_thoughts,
and produces a cited markdown brief. Enforces thought:<id> citations
throughout.

Co-Authored-By: Claude <noreply@anthropic.com>
Install instructions, skill descriptions, tips, and troubleshooting.
Written for end users, not plugin developers.

Co-Authored-By: Claude <noreply@anthropic.com>
Documents skill conventions (progressive disclosure, citations,
graceful empty-brain), version source of truth, local test procedure,
and CI checks.

Co-Authored-By: Claude <noreply@anthropic.com>
Scans SKILL.md files and hook scripts for mcp__ai-brain__<tool>
references, cross-checks against the MCP_TOOL_NAMES registry in
apps/web/src/lib/mcp/tools.ts, and exits non-zero on drift.
Prevents the class of breakage where a server tool rename leaves
skill prompts pointing at nothing.

Co-Authored-By: Claude <noreply@anthropic.com>
- Registered tools: slice to MCP_TOOL_NAMES block before scanning,
  so unrelated snake_case strings in tools.ts can't pollute the set.
- Hook refs: require method: "tools/call" context before matching
  name: "<tool>", so other JSON-RPC methods (e.g. future resources
  calls) don't create false positives.
- Allow digits in tool names via [a-z0-9_]+ for forward-compat.

Co-Authored-By: Claude <noreply@anthropic.com>
Runs on any PR or push that touches plugin skills, the tool registry,
the drift check script itself, or its workflow. Fails the PR if a
skill references an unregistered tool.

Co-Authored-By: Claude <noreply@anthropic.com>
Reads the plugin version and metadata from
plugins/ai-brain/.claude-plugin/plugin.json and emits a flat
marketplace.json suitable for a single-plugin distribution repo
(source: "./"). Keeps version as single source of truth.

Co-Authored-By: Claude <noreply@anthropic.com>
Triggered on version tag push (v*) or manual dispatch. Clones the
distribution repo with SSH deploy key, wipes contents except .git
and README.md, copies plugins/ai-brain/* to the root, generates a
flat marketplace.json, commits, tags, and pushes. Version tags are
mirrored exactly from source to distribution.

Co-Authored-By: Claude <noreply@anthropic.com>
- Pass all ${{ }} variables through env: to eliminate script injection
  risk (github.event_name, inputs.tag, steps.ref.outputs.tag).
- Detect distribution default branch instead of hardcoding main.
- Add idempotent tag check: fail fast with a clear message if the
  source tag already exists in the distribution repo.
- Add permissions: contents: read for least privilege.
- Add concurrency group to prevent race on concurrent tag pushes.

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-brain Ready Ready Preview, Comment Apr 20, 2026 11:07pm

Request Review

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Migrate open-brain plugin to ai-brain repo with v3 upgrades and distribution CI

✨ Enhancement 🧪 Tests 📝 Documentation

Grey Divider

Walkthroughs

Description
• Migrates the open-brain plugin from flippyhead/radar to this repo as ai-brain with
  comprehensive v3 server upgrades (hybrid search, progressive disclosure, timeline, citations)
• Implements 5 skills: brain-init (zero-input bootstrapping), brain-sync (project context sync),
  weekly-review (timeline-based synthesis), brain-thread (topic evolution tracing),
  brain-context (temporal memory retrieval)
• Adds SessionStart hook (check-brain-status) to detect empty brains and suggest initialization
• Establishes CI/CD infrastructure: skill→tool drift validation workflow, plugin distribution mirror
  publishing to flippyhead/ai-brain-plugin on version tag push
• Includes marketplace configurations for dev installs and distribution, plugin manifest as single
  source of truth for versioning
• Provides comprehensive documentation: design spec, implementation plan, user guide, and developer
  maintenance guidelines
Diagram
flowchart LR
  radar["flippyhead/radar<br/>open-brain plugin"]
  migration["Migration Process"]
  aibrain["ai-brain repo<br/>5 skills + hook"]
  cicheck["Skill→Tool<br/>Drift Check"]
  publish["Publish Workflow<br/>on tag push"]
  distmirror["flippyhead/ai-brain-plugin<br/>Distribution Mirror"]
  
  radar -- "migrate & upgrade" --> migration
  migration --> aibrain
  aibrain -- "validate" --> cicheck
  aibrain -- "trigger on version tag" --> publish
  publish -- "sync plugin source" --> distmirror
Loading

Grey Divider

File Changes

1. docs/superpowers/plans/2026-04-20-ai-brain-plugin-migration.md 📝 Documentation +2234/-0

Complete implementation plan for ai-brain plugin migration

• Comprehensive implementation plan for migrating the open-brain plugin from flippyhead/radar to
 ai-brain repo, renamed to ai-brain with v3 server upgrades
• Detailed task-by-task breakdown across 4 phases: plugin scaffolding in ai-brain, CI/distribution
 setup, radar cleanup, and documentation
• Includes step-by-step instructions for creating plugin manifests, marketplace configs, MCP setup,
 migrating/upgrading 3 existing skills, writing 2 new skills, setting up CI workflows, and end-to-end
 testing
• Covers skill implementations (brain-init, brain-sync, weekly-review, brain-thread,
 brain-context), hook migration, drift-check script, and distribution repo publishing via GitHub
 Actions

docs/superpowers/plans/2026-04-20-ai-brain-plugin-migration.md


2. docs/superpowers/specs/2026-04-20-ai-brain-plugin-migration-design.md 📝 Documentation +326/-0

Design spec for ai-brain plugin migration and distribution

• Design specification for migrating open-brain plugin to ai-brain repo with v3 server upgrades
 (hybrid search, progressive disclosure, timeline, citations)
• Architecture overview covering repo layout, distribution via CI mirror to
 flippyhead/ai-brain-plugin, skill upgrades and new skills leveraging timeline_thoughts
• Defines 4 implementation phases, verification strategy, version bumping rules, and risk mitigation
 for skill→tool drift via CI checks
• Includes success criteria, non-goals, and follow-up work (server test coverage plan)

docs/superpowers/specs/2026-04-20-ai-brain-plugin-migration-design.md


3. plugins/ai-brain/skills/brain-init/SKILL.md ✨ Enhancement +127/-0

Brain-init skill for zero-input brain bootstrapping

• New skill definition for bootstrapping AI Brain from connected tools and Claude's memory with
 zero-input onboarding
• Workflow covers: checking brain status, discovering connectors (email, calendar, ClickUp, GitHub,
 Slack, Linear, Jira), extracting meta-knowledge, importing Claude memory, fallback questions,
 synthesizing and saving thoughts with duplicate checking via search_thoughts and get_thoughts
• Reports captured thoughts with thought:<id> citations and suggests /brain-thread and
 /brain-context as next steps

plugins/ai-brain/skills/brain-init/SKILL.md


View more (15)
4. plugins/ai-brain/skills/weekly-review/SKILL.md ✨ Enhancement +113/-0

Weekly-review skill with timeline-based synthesis

• New skill definition for weekly synthesis of brain thoughts, workflow insights, and goals with
 full citation support
• Workflow establishes week's time window, pulls timeline via timeline_thoughts, hydrates up to 10
 noteworthy thoughts, and produces 5-section report (30-second summary, attention vs. intention,
 knowledge captured, open loops, next week)
• Every factual claim must cite sources as thought:<id>, insight:<id>, or list:<id>; offers to
 save review summary back to brain

plugins/ai-brain/skills/weekly-review/SKILL.md


5. .github/workflows/skill-tool-drift-check.yml ⚙️ Configuration changes +28/-0

CI workflow for skill-tool drift validation

• New GitHub Actions workflow that runs skill→tool drift check on every PR and push to main
• Triggers on changes to plugin skills, MCP tool registry, drift-check script, or the workflow
 itself
• Sets up Node.js 20 and executes the drift-check script to verify all skill tool references are
 registered

.github/workflows/skill-tool-drift-check.yml


6. .claude-plugin/marketplace.json ⚙️ Configuration changes +18/-0

Root marketplace config for ai-brain plugin

• New marketplace configuration for dev/direct installs of the ai-brain plugin at repo root
• Defines single plugin entry with name ai-brain, version 3.0.0, pointing to
 ./plugins/ai-brain as source
• Includes schema reference, owner metadata (Peter Brown), and plugin description

.claude-plugin/marketplace.json


7. plugins/ai-brain/skills/brain-context/SKILL.md ✨ Enhancement +103/-0

Brain Context skill for temporal memory retrieval

• Introduces the brain-context skill for restoring ambient context at a specific moment in time
• Implements 5-step workflow: resolve anchor timestamp, pull timeline window, triage for diversity,
 synthesize cited brief, offer next steps
• Handles both date parsing (ISO 8601, natural language) and event-like phrase search via
 mcp__ai-brain__search_thoughts
• Enforces citation discipline with thought:<id> references for all factual claims in synthesized
 output

plugins/ai-brain/skills/brain-context/SKILL.md


8. plugins/ai-brain/skills/brain-thread/SKILL.md ✨ Enhancement +103/-0

Brain Thread skill for topic evolution tracing

• Introduces the brain-thread skill for reconstructing chronological evolution of thinking on a
 topic
• Implements 5-step workflow: resolve seed (topic or thought ID), walk timeline, triage and hydrate
 substantive neighbors, synthesize narrative, offer next steps
• Supports optional --type filter to narrow timeline to specific thought types
• Enforces citation discipline with thought:<id> references for all claims in narrative output

plugins/ai-brain/skills/brain-thread/SKILL.md


9. plugins/ai-brain/skills/brain-sync/SKILL.md ✨ Enhancement +108/-0

Brain Sync skill for project context synchronization

• Introduces the brain-sync skill for syncing current project context into the AI Brain
• Implements 6-step workflow: gather project context, derive project name, search brain via
 progressive disclosure, synthesize and diff, sync to brain, report to user
• Uses compact index triage followed by selective hydration to avoid full-content assumptions
• Captures only new or changed information, citing unchanged facts via thought:<id> for user
 confirmation

plugins/ai-brain/skills/brain-sync/SKILL.md


10. .github/scripts/skill-tool-drift-check.mjs 🧪 Tests +136/-0

Skill-to-tool drift validation for CI pipeline

• Implements CI validation script to detect mismatches between skill/hook tool references and
 registered tools
• Scans plugins/ai-brain/skills/*/SKILL.md for mcp__ai-brain__<tool> patterns and hooks for
 tools/call method invocations
• Reads registered tool names from apps/web/src/lib/mcp/tools.ts and exits with error if
 unregistered tools are referenced
• Provides detailed error reporting listing offending files and available registered tools

.github/scripts/skill-tool-drift-check.mjs


11. .github/workflows/publish-plugin.yml ⚙️ Configuration changes +132/-0

Plugin distribution mirror publishing workflow

• Implements CI workflow for publishing plugin to distribution mirror repo
 flippyhead/ai-brain-plugin
• Triggered on version tag push or manual workflow dispatch with tag input
• Clones distribution repo via SSH deploy key, copies plugin source, generates flat
 marketplace.json, commits and tags
• Includes safeguards: verifies tag doesn't already exist, preserves .git and README.md, detects
 no-op commits

.github/workflows/publish-plugin.yml


12. plugins/ai-brain/hooks/check-brain-status.mjs ✨ Enhancement +104/-0

SessionStart hook for empty brain detection

• Implements SessionStart hook to check if user's AI Brain has any thoughts
• Initializes MCP session, calls get_stats tool, and suggests /brain-init if brain is empty
• Reads brain URL from .mcp.json config with fallback to default hosted server
• Supports multiple auth header formats (AI_BRAIN_AUTHORIZATION, MCP_AUTHORIZATION, token-based)
 with graceful timeout handling

plugins/ai-brain/hooks/check-brain-status.mjs


13. plugins/ai-brain/CLAUDE.md 📝 Documentation +53/-0

Plugin development and maintenance guidelines

• Provides developer guidance for maintaining the AI Brain plugin source
• Documents version bumping rules (patch/minor/major) and single source of truth in plugin.json
• Specifies four skill conventions: namespaced tool names, progressive disclosure, citations,
 graceful empty-brain handling
• References CI checks (drift validation, publish workflow) and relationship to MCP server in same
 repo

plugins/ai-brain/CLAUDE.md


14. plugins/ai-brain/README.md 📝 Documentation +65/-0

User documentation for AI Brain plugin

• Provides user-facing documentation for the AI Brain plugin
• Describes five skills (/brain-init, /brain-sync, /weekly-review, /brain-thread,
 /brain-context) and SessionStart hook
• Includes installation instructions, authentication setup, usage tips, and troubleshooting guidance
• Explains plugin architecture as thin client over hosted MCP server with emphasis on citable
 sources

plugins/ai-brain/README.md


15. .github/scripts/generate-dist-marketplace.mjs ⚙️ Configuration changes +64/-0

Distribution marketplace.json generator script

• Implements script to generate distribution repo's marketplace.json from source plugin manifest
• Reads version from plugins/ai-brain/.claude-plugin/plugin.json as single source of truth
• Generates marketplace entry with plugin metadata (name, description, version, author)
• Ensures distribution marketplace version always stays synchronized with source plugin version

.github/scripts/generate-dist-marketplace.mjs


16. plugins/ai-brain/.claude-plugin/plugin.json ⚙️ Configuration changes +19/-0

Plugin manifest with metadata and version

• Defines plugin manifest with metadata: name ai-brain, version 3.0.0, author Peter Brown
• Specifies description emphasizing hybrid search, timeline retrieval, and citable thoughts
• Includes repository link to flippyhead/ai-brain, MIT license, and relevant keywords
• Serves as single source of truth for version across dev and distribution marketplaces

plugins/ai-brain/.claude-plugin/plugin.json


17. plugins/ai-brain/hooks/hooks.json ⚙️ Configuration changes +16/-0

Hook configuration for SessionStart event

• Defines hook configuration for SessionStart event
• Registers check-brain-status.mjs command to run on startup with 10-second timeout
• Uses matcher startup to trigger on session initialization

plugins/ai-brain/hooks/hooks.json


18. plugins/ai-brain/.mcp.json ⚙️ Configuration changes +8/-0

MCP server configuration for plugin

• Configures MCP server connection for the plugin
• Specifies ai-brain server as HTTP type pointing to hosted instance at
 https://ai-brain-pi.vercel.app/api/mcp
• Enables plugin to discover and communicate with the backend MCP server

plugins/ai-brain/.mcp.json


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Apr 20, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Tag mirror skipped 🐞 Bug ≡ Correctness
Description
In publish-plugin.yml, the workflow exits early when there are no staged file changes, so it never
creates/pushes the distribution tag even though the tag was verified not to exist. This breaks the
“mirror tags exactly” behavior and can leave the distribution repo missing the version tag users
expect.
Code

.github/workflows/publish-plugin.yml[R98-123]

+      - name: Commit and tag
+        id: publish
+        env:
+          TAG: ${{ steps.ref.outputs.tag }}
+        run: |
+          cd dist
+          git add -A
+          if git diff --staged --quiet; then
+            echo "No changes — skipping commit/tag."
+            echo "changed=false" >> "$GITHUB_OUTPUT"
+            exit 0
+          fi
+          git commit -m "release: ai-brain $TAG (from flippyhead/ai-brain@$TAG)"
+          git tag "$TAG"
+          echo "changed=true" >> "$GITHUB_OUTPUT"
+
+      - name: Push commit and tag to distribution
+        if: steps.publish.outputs.changed == 'true'
+        env:
+          TAG: ${{ steps.ref.outputs.tag }}
+          BRANCH: ${{ steps.distbranch.outputs.branch }}
+        run: |
+          cd dist
+          git push origin "$BRANCH"
+          git push origin "$TAG"
+
Evidence
The workflow verifies the tag does not already exist in the distribution repo, but then the `Commit
and tag` step exits before creating the tag when there are no staged changes; since the push step is
conditional on changed == 'true', the tag will not be pushed either.

.github/workflows/publish-plugin.yml[62-70]
.github/workflows/publish-plugin.yml[98-123]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The publish workflow currently skips `git tag` (and the subsequent push) when `git diff --staged --quiet` indicates no content changes in the distribution repo. This can cause a source tag (e.g. `v3.0.0-rc.1`) to *not* be mirrored to the distribution repo even though the workflow verified the tag doesn’t already exist.

## Issue Context
Even if the mirrored plugin contents are identical to the previous distribution commit, the distribution repo should still receive the new tag so that tags mirror the source repo’s versioning contract.

## Fix Focus Areas
- .github/workflows/publish-plugin.yml[98-123]

## Implementation guidance
- Separate “commit if changed” from “tag always”.
- If no changes:
 - Create the tag pointing at the current checked-out commit in `dist`.
 - Push the tag (and optionally skip pushing the branch).
- If changes:
 - Commit, create the tag, and push both branch and tag.
- Ensure the push step(s) run when a tag was created, not only when a commit was created.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. README preservation negated 🐞 Bug ⚙ Maintainability
Description
The workflow claims it preserves dist/README.md during the wipe, but then `cp -R
source/plugins/ai-brain/. dist/ overwrites dist/README.md` because the plugin source includes its
own README. Any manual edits to the distribution repo’s README will be lost on every publish.
Code

.github/workflows/publish-plugin.yml[R72-86]

+      - name: Clear distribution contents (preserve .git and README.md)
+        run: |
+          cd dist
+          shopt -s dotglob
+          for item in *; do
+            case "$item" in
+              .git|README.md) continue ;;
+              *) rm -rf -- "$item" ;;
+            esac
+          done
+
+      - name: Copy plugin source into distribution
+        run: |
+          cp -R source/plugins/ai-brain/. dist/
+
Evidence
The clear step explicitly skips deleting README.md, but the subsequent recursive copy from the
plugin source will copy plugins/ai-brain/README.md into dist/README.md, overwriting the
preserved file.

.github/workflows/publish-plugin.yml[72-86]
plugins/ai-brain/README.md[1-26]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The publish workflow’s intent (“preserve README.md”) is negated by the later copy step which overwrites `dist/README.md` with the plugin’s README.

## Issue Context
You should decide which README is authoritative:
- If the distribution repo README is meant to be manually maintained/preserved, it must not be overwritten by the copy.
- If the plugin README is meant to be the distribution README, then the workflow should stop claiming it’s preserved (and the dist-repo bootstrap instructions should reflect that).

## Fix Focus Areas
- .github/workflows/publish-plugin.yml[72-86]

## Implementation guidance
Option A (actually preserve dist README):
- Move `dist/README.md` aside before the copy and restore it after, or adjust the copy step to exclude `README.md`.

Option B (make plugin README authoritative):
- Remove `README.md` from the preservation list/comment so the workflow behavior matches the stated intent (README will be replaced every publish).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@flippyhead flippyhead merged commit f7eefb6 into main Apr 20, 2026
3 of 4 checks passed
@flippyhead flippyhead deleted the feat/ai-brain-plugin-migration branch April 20, 2026 23:12
Comment on lines +98 to +123
- name: Commit and tag
id: publish
env:
TAG: ${{ steps.ref.outputs.tag }}
run: |
cd dist
git add -A
if git diff --staged --quiet; then
echo "No changes — skipping commit/tag."
echo "changed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
git commit -m "release: ai-brain $TAG (from flippyhead/ai-brain@$TAG)"
git tag "$TAG"
echo "changed=true" >> "$GITHUB_OUTPUT"

- name: Push commit and tag to distribution
if: steps.publish.outputs.changed == 'true'
env:
TAG: ${{ steps.ref.outputs.tag }}
BRANCH: ${{ steps.distbranch.outputs.branch }}
run: |
cd dist
git push origin "$BRANCH"
git push origin "$TAG"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Tag mirror skipped 🐞 Bug ≡ Correctness

In publish-plugin.yml, the workflow exits early when there are no staged file changes, so it never
creates/pushes the distribution tag even though the tag was verified not to exist. This breaks the
“mirror tags exactly” behavior and can leave the distribution repo missing the version tag users
expect.
Agent Prompt
## Issue description
The publish workflow currently skips `git tag` (and the subsequent push) when `git diff --staged --quiet` indicates no content changes in the distribution repo. This can cause a source tag (e.g. `v3.0.0-rc.1`) to *not* be mirrored to the distribution repo even though the workflow verified the tag doesn’t already exist.

## Issue Context
Even if the mirrored plugin contents are identical to the previous distribution commit, the distribution repo should still receive the new tag so that tags mirror the source repo’s versioning contract.

## Fix Focus Areas
- .github/workflows/publish-plugin.yml[98-123]

## Implementation guidance
- Separate “commit if changed” from “tag always”.
- If no changes:
  - Create the tag pointing at the current checked-out commit in `dist`.
  - Push the tag (and optionally skip pushing the branch).
- If changes:
  - Commit, create the tag, and push both branch and tag.
- Ensure the push step(s) run when a tag was created, not only when a commit was created.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cf43130. Configure here.

{
"name": "ai-brain",
"description": "Personal AI memory — hybrid search, timeline retrieval, citable thoughts.",
"version": "3.0.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root marketplace version hardcoded despite "single source of truth" design

Medium Severity

The root .claude-plugin/marketplace.json hardcodes "version": "3.0.0", but CLAUDE.md states the version's single source of truth is plugin.json and says "Don't hand-edit marketplace versions." Only the distribution marketplace is generated from plugin.json by CI; the root marketplace is a static file with no sync mechanism. On the next version bump to plugin.json, the root marketplace will silently drift — and the CLAUDE.md guidance actively discourages the manual fix needed to correct it.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cf43130. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant