Skip to content

Improve onboarding: agent-driven setup, prebuilt wheels, tests, CI - #1

Merged
rubybear-lgtm merged 3 commits into
mainfrom
feat/onboarding-improvements
Jun 20, 2026
Merged

rubybear-lgtm merged 3 commits into
mainfrom
feat/onboarding-improvements

Conversation

@rubybear-lgtm

Copy link
Copy Markdown
Owner

Summary

Makes FastContext installation easier across Claude Code, OpenCode, and Codex CLI. The skill was easy (npx add skill), but the MCP server install was harder — requiring manual curl|bash and config edits. This PR closes that gap with agent-driven setup, prebuilt wheels, and comprehensive tests.

Changes

Agent-driven setup skill

  • Rewrites skills/fastcontext-setup/SKILL.md as an agent-executable procedure (guard check → install → verify → report) instead of a user-facing how-to. The user just says "install FastContext" and the agent runs the commands.
  • Adds architecture diagram explaining the skill/MCP two-part system to both skill files.

Prebuilt wheel releases

  • src/fastcontext_mcp/release.py — resolves and downloads prebuilt wheels from GitHub releases with graceful fallback to git source.
  • src/fastcontext_mcp/configwriter.py — extracts MCP config + skill file install logic into a testable module (previously inline Python in install.sh).
  • scripts/install.sh now:
    • Prefers prebuilt wheel by default (--from-source to override)
    • Supports --install-skills to also install skill files + symlinks
    • Has --help with full usage docs
  • .github/workflows/release.yml — builds and publishes wheels to GitHub Releases on tag push (v*).

Documentation

  • Rewrites README.md with architecture overview, one-command install, and prebuilt wheel instructions.
  • Adds "How it works" section to skills/fastcontext/SKILL.md.
  • Documents --install-skills and --from-source flags in setup skill.

Tests + CI (109 tests, all passing)

  • tests/test_configwriter.py — MCP config writing for all three tools (Claude/OpenCode/Codex), idempotency, skill file install, symlinks.
  • tests/test_release.py — wheel resolution with mocked GitHub API, fallback logic, download.
  • tests/test_skills.py — skill content validation (frontmatter, agent-driven sections, architecture docs, link consistency).
  • tests/test_install_script.py — install.sh syntax, flags, help output, content checks.
  • .github/workflows/ci.yml — runs tests + ruff + shellcheck on every push/PR.
  • Adds ruff + pytest config to pyproject.toml.
  • Fixes pre-existing lint issues in server.py (unused Context import, f-string without placeholders).

Install flow (after this PR)

# User runs one command:
npx add skill fastcontext-setup

# Then tells their agent:
"Install FastContext"

# Agent follows the skill, runs install.sh, which:
# 1. Downloads prebuilt wheel from latest GitHub release (no git clone)
# 2. Creates venv + installs package
# 3. Auto-detects Claude/OpenCode/Codex
# 4. Registers MCP config
# 5. Verifies model loads
# 6. Reports "restart your tool"

Test results

109 passed in 2.30s
ruff: All checks passed!
bash -n install.sh: syntax OK

To create the first release

After merge, tag and push to trigger the release workflow:

git tag v0.1.0
git push origin v0.1.0

This builds the wheel and attaches it to a GitHub Release. The install script will then download it automatically.

Ruben T added 3 commits June 20, 2026 11:40
Make FastContext installation easier across Claude Code, OpenCode, and
Codex CLI. The skill can be added with `npx add skill`, but the MCP
server install was harder — requiring manual curl|bash and config edits.

Agent-driven setup skill:
- Rewrite fastcontext-setup/SKILL.md as agent-executable procedure (guard
  check, install, verify, report) instead of user-facing how-to
- Add architecture diagram explaining the skill/MCP two-part system

Prebuilt wheel releases:
- Add src/fastcontext_mcp/release.py to resolve/download wheels from
  GitHub releases with graceful fallback to git source
- Add src/fastcontext_mcp/configwriter.py extracting MCP config + skill
  file install logic into a testable module
- install.sh now prefers prebuilt wheel by default (--from-source to
  override) and supports --install-skills to also install skill files
- Add .github/workflows/release.yml to build+publish wheels on tag push

Documentation:
- Rewrite README with architecture overview, one-command install, and
  prebuilt wheel instructions
- Add how-it-works section to fastcontext/SKILL.md
- Document --install-skills and --from-source in setup skill

Tests + CI:
- Add 109 tests covering configwriter (MCP config writing for all three
  tools, skill file install, symlinks), release (wheel resolution with
  mocked GitHub API), skill content (frontmatter, agent-driven
  sections, architecture docs), and install.sh (syntax, flags, help)
- Add .github/workflows/ci.yml running tests + ruff + shellcheck
- Add ruff + pytest config to pyproject.toml
- Fix pre-existing lint issues in server.py (unused import, f-string)
Address PR review feedback:

1. mktemp --suffix macOS incompatibility (critical):
   - macOS BSD mktemp doesn't support --suffix
   - Use mktemp -d + filename instead (portable)
   - Add test_uses_portable_mktemp to guard against regression

2. Prebuilt wheel bootstrap (items 1-2):
   - Inline wheel resolution using stdlib only (json, re, urllib)
   - No import from fastcontext_mcp.release in the bootstrap phase
   - Works on first install when the package isn't installed yet
   - release.py kept for programmatic use after install
   - Add test_wheel_resolution_is_stdlib_only to enforce this

3. Error handling for step 4:
   - Add import check before configwriter usage
   - Clear error message if package install failed

4. Codex skill dirs comment:
   - Document that Codex CLI has no skill directory system

5. urlretrieve → urlopen+write:
   - Replace semi-deprecated urlretrieve with urlopen + write
   - Consistent with _api_get pattern
   - Update download_wheel tests accordingly
The setup-uv action with enable-cache defaults to looking for uv.lock,
which doesn't exist in this project (we use pyproject.toml). Point the
cache dependency glob at pyproject.toml instead.
@rubybear-lgtm
rubybear-lgtm merged commit 749987e into main Jun 20, 2026
3 checks passed
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