Skip to content

feat(integrations): Cursor + install.sh --dry-run + stale-doc sweep - #32

Merged
slavazeph-coder merged 2 commits into
mainfrom
claude/crumb-v1.3-spec-YCqPD
May 8, 2026
Merged

feat(integrations): Cursor + install.sh --dry-run + stale-doc sweep#32
slavazeph-coder merged 2 commits into
mainfrom
claude/crumb-v1.3-spec-YCqPD

Conversation

@slavazeph-coder

Copy link
Copy Markdown
Contributor

Summary

Phase 1 of the post-1.0 roadmap. Doubles the IDE coverage (Claude Code + Cursor today) and lays trust groundwork (--dry-run previews + integration smoke tests + stale-doc cleanup). No wire-format change; all additive.

What ships

integrations/cursor/ — Cursor is now a one-line install

bash <(curl -fsSL https://raw.githubusercontent.com/XioAISolutions/crumb-format/main/integrations/cursor/install.sh)
File Purpose
install.sh Registers global MCP server in ~/.cursor/mcp.json; optionally copies rule files into ./.cursor/rules/. Idempotent, marker-tracked.
uninstall.sh Reverses install. Preserves user-managed entries (those without the install.sh marker).
mcp.json.template Same __CRUMB_PYTHON__ / __CRUMB_INSTALL_PATH__ substitution shape as Claude Code. Carries _managed_by field.
rules/crumb-export.mdc Fires on "crumb it" / "export as CRUMB" — produces a kind=task (or right kind) crumb.
rules/crumb-import.mdc Fires automatically when a .crumb file is opened or pasted.
rules/crumb-it.mdc alwaysApply: true — ambient format recognition for the verbal trigger.
README.md Install + usage + differences from Claude Code.

Mirrors the Claude Code integration's three-artifact pattern. Cursor uses .cursor/rules/*.mdc files instead of slash commands; the per-project rules install only when the user is in a .cursor/-tracked dir or opts in interactively.

install.sh --dry-run

Both claude-code/install.sh and cursor/install.sh accept --dry-run (or -n). Every write — mkdir, file write, MCP merge, CLAUDE.md append prompt — prints what it would do without touching the filesystem.

$ bash integrations/cursor/install.sh --dry-run
==> DRY RUN — no files will be written.
==> Registering MCP server in /root/.cursor/mcp.json
   [dry-run] mkdir -p /root/.cursor
   [dry-run] would create /root/.cursor/mcp.json with {}
   [dry-run] would merge into /root/.cursor/mcp.json:
   [dry-run]   { "mcpServers": { "crumb": { "command": "/usr/bin/python3", ... } } }
  +  crumb MCP server registered (interpreter: /usr/bin/python3)
==> Project rules
   ./.cursor not found; not prompting (non-interactive stdin).
   To install rules into the current project later, run:
     mkdir -p ./.cursor/rules && cp .../rules/*.mdc ./.cursor/rules/
==> Dry run complete. Re-run without --dry-run to apply.

--help and unknown-arg rejection (exit 2) also added.

Stale-doc sweep

Eight docs that described draft-or-shipped designs are now correctly labeled. grep -rln "TODO(author)" docs/ returns zero.

File Before After
docs/v1.2-ref-resolution.md "Status: open, draft. v1.2 ships..." + ## TODO(author) "Status: shipped in v=1.3 (see SPEC.md §17)"
docs/v1.2-fold-heuristic.md "Status: open, draft. v1.2 ships..." + ## TODO(author) "Status: shipped in v=1.3 (see SPEC.md §18)"
docs/v1.3-DRAFT.md "Status: draft for review" "Status: shipped. v=1.3 is normative in SPEC.md"
docs/v1.4-scoping.md "Status: Scoping only. Nothing on this page is normative" "Status: v1.4 has shipped. SPEC.md is the normative reference"
docs/v1.4/handoff-deadlines.md "Status: Draft. Non-normative" "Status: shipped in v=1.4 (see SPEC.md §11.4)"
docs/v1.4/typed-checks.md "Status: Draft. Non-normative" "Status: shipped in v=1.4 (see SPEC.md §21.1.1)"
docs/v1.4/agent-failure-modes.md "Status: Draft. Non-normative" "Status: shipped in v=1.4 (see SPEC.md §21.1.2)"
docs/integrations/cursor.md "Status: Plan only. No code yet." "Status: shipping" + install pointer

README

Added a "Native integrations — crumb it inside your AI tool" section right after the CLI install block, with one-line install commands for both Claude Code and Cursor and pointers to the per-integration READMEs. Existing CLI block now mentions crumb hello and crumb doctor so new users see them.

Test plan

  • python3 -m pytest tests/ -q673 passing (was 652; +21 in tests/test_integrations_smoke.py)
  • bash -n integrations/{claude-code,cursor}/install.sh integrations/{claude-code,cursor}/uninstall.sh — all syntax-clean
  • bash integrations/cursor/install.sh --dry-run produces clean preview, writes nothing
  • bash integrations/claude-code/install.sh --dry-run ditto
  • bash integrations/{claude-code,cursor}/install.sh --bogus exits 2 with clear error
  • All Cursor .mdc rules pass frontmatter validation; crumb-it is alwaysApply: true, others false
  • Both MCP templates render to valid JSON after substitution
  • Both uninstallers reference _managed_by marker before deleting
  • grep -rln "TODO(author)" docs/ returns nothing

Stats

19 files changed, +807 / -41.

Group Change
integrations/cursor/ (new) 7 files: 3 rules, install/uninstall, MCP template, README
integrations/claude-code/install.sh +--dry-run, --help, unknown-arg rejection
tests/test_integrations_smoke.py (new) 21 tests, parametrized over both integrations
docs/ 8 stale design docs relabeled
README.md new "Native integrations" section
CHANGELOG.md new entry under Unreleased

Out of scope (for follow-ups)

  • Demo GIF in README hero. Need to actually record one. The structural slot is in the README's existing banner SVG; the GIF would replace or sit beside it.
  • Aider / OpenCode integrations — Phase 3 work. Briefs already in docs/integrations/.
  • e2e roundtrip tests (tests/test_e2e_roundtrip.py) — Phase 2 work. This PR's smoke tests cover installer shape; e2e covers new → handoff → receive → resume.
  • JSON Schema for v=1.4 — Phase 2 work.
  • crumb context glow-up — Phase 2 work.

Sequencing

Stacks cleanly on top of main post-PR-31. Phase 2 (e2e tests + JSON schema + crumb context) can start once this lands.

https://claude.ai/code/session_01Ewf1noyQc9gc6DmohyR32z


Generated by Claude Code

claude and others added 2 commits May 8, 2026 16:21
Phase 1 of the post-1.0 roadmap. No wire-format change; all additive.

integrations/cursor/ — mirrors integrations/claude-code/ shape:
  - install.sh registers ~/.cursor/mcp.json globally and optionally
    copies .cursor/rules/{crumb-export,crumb-import,crumb-it}.mdc
    into the current project. Marker-tracked, idempotent.
  - uninstall.sh respects the install.sh marker (preserves
    user-managed entries).
  - mcp.json.template uses the same __CRUMB_PYTHON__ /
    __CRUMB_INSTALL_PATH__ substitution shape as Claude Code.
  - Three .mdc rule files: crumb-it is alwaysApply: true (ambient
    format recognition); crumb-export and crumb-import fire on
    demand or on .crumb file open.

install.sh --dry-run on both Claude Code and Cursor installers.
Shows every action (mkdir, file write, MCP merge, prompt) without
touching the filesystem. Reject unknown args with exit 2.

Stale design-doc sweep:
  - docs/v1.2-ref-resolution.md, docs/v1.2-fold-heuristic.md:
    cleared TODO(author) markers; "shipped in v=1.3" headers.
  - docs/v1.3-DRAFT.md: "shipped" header.
  - docs/v1.4-scoping.md: "shipped" header.
  - docs/v1.4/{agent-failure-modes,handoff-deadlines,typed-checks}.md:
    "shipped in v=1.4" headers.
  - docs/integrations/cursor.md: "Plan only" → "shipping".
  - grep -rln "TODO(author)" docs/ now returns zero.

README: new "Native integrations" section with one-line install
pointers for Claude Code and Cursor; CLI install block now mentions
crumb hello and crumb doctor.

21 new tests in tests/test_integrations_smoke.py:
  - per-integration installer syntax + --help + --dry-run + unknown-arg
  - MCP template renders to valid JSON after substitution
  - Cursor rule frontmatter checks (crumb-it always-apply, others not)
  - Claude Code slash command frontmatter checks
  - uninstaller marker-check assertion
673 passing total (was 652).

https://claude.ai/code/session_01Ewf1noyQc9gc6DmohyR32z
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

✅ Shadow AI Scan

No Shadow AI findings detected at or above medium risk.

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

CRUMB Bench Results

File Score Grade Tokens Compression
./.crumb N/A - - -
./.crumb/latest.crumb N/A - - -
./CODEX_HANDOFF_0.4.0.crumb 58/100 C ~1985 1.6x
./crumbs/map.crumb 79/100 B ~269 1.6x
./crumbs/mem.crumb 80/100 B ~225 1.7x
./examples/halo-trace-to-log.crumb 84/100 B ~155 2.0x
./examples/log-deployment.crumb 84/100 B ~147 2.0x
./examples/map-client-takeover.crumb 78/100 B ~290 1.6x
./examples/map-repo-onboarding.crumb 82/100 B ~166 1.7x
./examples/mem-mempalace-auth-migration.crumb 87/100 A ~120 2.5x
./examples/mem-terse-output.crumb 77/100 B ~336 1.6x
./examples/mem-user-preferences.crumb 83/100 B ~135 1.8x
./examples/task-bug-fix.crumb 83/100 B ~127 1.7x
./examples/task-content-repurpose-handoff.crumb 80/100 B ~250 1.7x
./examples/task-cross-tool-feature-handoff.crumb 79/100 B ~249 1.6x
./examples/task-feature-continuation.crumb 82/100 B ~134 1.7x
./examples/task-packed-auth-context.crumb 82/100 B ~233 2.1x
./examples/todo-sprint.crumb 84/100 B ~90 1.7x
./examples/v12-content-ref.crumb 82/100 B ~193 1.8x
./examples/v12-delta.crumb 78/100 B ~344 1.8x
./examples/v12-fold.crumb 61/100 C ~317 1.4x
./examples/v12-handoff.crumb 80/100 B ~204 1.4x
./examples/v12-priority.crumb 79/100 B ~254 1.6x
./examples/v12-refs.crumb 82/100 B ~182 1.8x
./examples/v12-typed-content.crumb 80/100 B ~218 1.5x
./examples/v13-agent.crumb 82/100 B ~167 1.7x
./examples/v13-checks.crumb 80/100 B ~165 1.3x
./examples/v13-fold-priority.crumb 64/100 C ~223 1.4x
./examples/v13-guardrails.crumb 80/100 B ~205 1.5x
./examples/v13-handoff-deps.crumb 80/100 B ~201 1.6x
./examples/v13-script.crumb 80/100 B ~169 1.4x
./examples/v13-workflow.crumb 81/100 B ~178 1.6x
./examples/v14-handoff-deadlines.crumb 79/100 B ~290 1.7x
./examples/v14-release-gate.crumb 79/100 B ~295 1.8x
./examples/v14-typed-checks.crumb 80/100 B ~223 1.5x
./examples/wake-session.crumb 84/100 B ~195 2.2x
./fixtures/extensions/mempalace-export.crumb 86/100 A ~102 2.3x
./fixtures/extensions/task-packed.crumb 85/100 B ~157 2.3x
./fixtures/invalid/bad-kind.crumb N/A - - -
./fixtures/invalid/missing-source.crumb N/A - - -
./fixtures/valid/agent-basic.crumb 80/100 B ~51 1.1x
./fixtures/valid/log-basic.crumb 82/100 B ~51 1.4x
./fixtures/valid/mem-basic.crumb 81/100 B ~42 1.2x
./fixtures/valid/task-basic.crumb 81/100 B ~65 1.2x
./fixtures/valid/v13-checks.crumb 81/100 B ~74 1.2x
./fixtures/valid/v13-handoff-deps.crumb 82/100 B ~93 1.3x

Powered by crumb-format — two-stage context compression

1 similar comment
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

CRUMB Bench Results

File Score Grade Tokens Compression
./.crumb N/A - - -
./.crumb/latest.crumb N/A - - -
./CODEX_HANDOFF_0.4.0.crumb 58/100 C ~1985 1.6x
./crumbs/map.crumb 79/100 B ~269 1.6x
./crumbs/mem.crumb 80/100 B ~225 1.7x
./examples/halo-trace-to-log.crumb 84/100 B ~155 2.0x
./examples/log-deployment.crumb 84/100 B ~147 2.0x
./examples/map-client-takeover.crumb 78/100 B ~290 1.6x
./examples/map-repo-onboarding.crumb 82/100 B ~166 1.7x
./examples/mem-mempalace-auth-migration.crumb 87/100 A ~120 2.5x
./examples/mem-terse-output.crumb 77/100 B ~336 1.6x
./examples/mem-user-preferences.crumb 83/100 B ~135 1.8x
./examples/task-bug-fix.crumb 83/100 B ~127 1.7x
./examples/task-content-repurpose-handoff.crumb 80/100 B ~250 1.7x
./examples/task-cross-tool-feature-handoff.crumb 79/100 B ~249 1.6x
./examples/task-feature-continuation.crumb 82/100 B ~134 1.7x
./examples/task-packed-auth-context.crumb 82/100 B ~233 2.1x
./examples/todo-sprint.crumb 84/100 B ~90 1.7x
./examples/v12-content-ref.crumb 82/100 B ~193 1.8x
./examples/v12-delta.crumb 78/100 B ~344 1.8x
./examples/v12-fold.crumb 61/100 C ~317 1.4x
./examples/v12-handoff.crumb 80/100 B ~204 1.4x
./examples/v12-priority.crumb 79/100 B ~254 1.6x
./examples/v12-refs.crumb 82/100 B ~182 1.8x
./examples/v12-typed-content.crumb 80/100 B ~218 1.5x
./examples/v13-agent.crumb 82/100 B ~167 1.7x
./examples/v13-checks.crumb 80/100 B ~165 1.3x
./examples/v13-fold-priority.crumb 64/100 C ~223 1.4x
./examples/v13-guardrails.crumb 80/100 B ~205 1.5x
./examples/v13-handoff-deps.crumb 80/100 B ~201 1.6x
./examples/v13-script.crumb 80/100 B ~169 1.4x
./examples/v13-workflow.crumb 81/100 B ~178 1.6x
./examples/v14-handoff-deadlines.crumb 79/100 B ~290 1.7x
./examples/v14-release-gate.crumb 79/100 B ~295 1.8x
./examples/v14-typed-checks.crumb 80/100 B ~223 1.5x
./examples/wake-session.crumb 84/100 B ~195 2.2x
./fixtures/extensions/mempalace-export.crumb 86/100 A ~102 2.3x
./fixtures/extensions/task-packed.crumb 85/100 B ~157 2.3x
./fixtures/invalid/bad-kind.crumb N/A - - -
./fixtures/invalid/missing-source.crumb N/A - - -
./fixtures/valid/agent-basic.crumb 80/100 B ~51 1.1x
./fixtures/valid/log-basic.crumb 82/100 B ~51 1.4x
./fixtures/valid/mem-basic.crumb 81/100 B ~42 1.2x
./fixtures/valid/task-basic.crumb 81/100 B ~65 1.2x
./fixtures/valid/v13-checks.crumb 81/100 B ~74 1.2x
./fixtures/valid/v13-handoff-deps.crumb 82/100 B ~93 1.3x

Powered by crumb-format — two-stage context compression

@slavazeph-coder
slavazeph-coder marked this pull request as ready for review May 8, 2026 16:28
@slavazeph-coder
slavazeph-coder merged commit a999bee into main May 8, 2026
slavazeph-coder added a commit that referenced this pull request May 8, 2026
First post-1.0 minor. No wire-format change (stays at v=1.4).
Semver-minor: adds Cursor integration (PR #32), three top-level CLI
commands (PR #31: hello, doctor, friendlier argparse errors),
--dry-run on installers, stale-doc cleanup.

CLI_VERSION → 1.1.0. pyproject.toml version → 1.1.0.

673 tests passing. 39/39 examples + fixtures green on Python and Node.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfc3880925

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +213 to +214
echo "$CRUMB_MANAGED_MARKER"
cat "$src"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep Cursor rule frontmatter as first line

Do not prepend the managed-marker line before copying .mdc rules, because this makes installed rule files start with <!-- ... --> instead of ---. The integration’s own rule contract assumes frontmatter is at the top (see tests/test_integrations_smoke.py asserting text.startswith("---\n")), so a non-dry-run install can write rule files Cursor may not parse/apply, breaking crumb-export/crumb-import/crumb-it behavior for end users.

Useful? React with 👍 / 👎.

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.

2 participants