diff --git a/.gitignore b/.gitignore index 3173281..59a14dc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ vendor/ cli /major major-dev -.idea \ No newline at end of file +.DS_Store +.idea diff --git a/plugins/major/.claude-plugin/plugin.json b/plugins/major/.claude-plugin/plugin.json deleted file mode 100644 index d4b0322..0000000 --- a/plugins/major/.claude-plugin/plugin.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "major", - "description": "Use the Major platform agentically — create, develop, and deploy web apps via Claude Code", - "author": { - "name": "Major Technology" - }, - "repository": "https://github.com/major-technology/cli", - "license": "MIT", - "skills": "./skills/", - "mcpServers": "./.mcp.json", - "hooks": "./hooks/auto-approve.json" -} diff --git a/plugins/major/.mcp.json b/plugins/major/.mcp.json deleted file mode 100644 index ac52af7..0000000 --- a/plugins/major/.mcp.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "major-resources": { - "type": "http", - "url": "https://go-api.prod.major.build/cli/v1/mcp", - "headersHelper": "bash -c 'TOKEN=$(major user token 2>/dev/null); ORG=$(major org id 2>/dev/null); echo \"{\\\"Authorization\\\": \\\"Bearer $TOKEN\\\", \\\"x-major-org-id\\\": \\\"$ORG\\\"}\"'" - }, - "major-platform": { - "type": "http", - "url": "https://api.prod.major.build/mcp/cli", - "headersHelper": "bash -c 'TOKEN=$(major user token 2>/dev/null); ORG=$(major org id 2>/dev/null); echo \"{\\\"Authorization\\\": \\\"Bearer $TOKEN\\\", \\\"x-major-org-id\\\": \\\"$ORG\\\"}\"'" - } -} diff --git a/plugins/major/README.md b/plugins/major/README.md deleted file mode 100644 index 0d25769..0000000 --- a/plugins/major/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# Major Claude Code Plugin - -Use the Major platform agentically through Claude Code. Create, develop, and deploy web apps without leaving your terminal. - -## Install - -### From Marketplace - -``` -/plugin marketplace add major-technology/cli -/plugin install major -``` - -### Local Development - -```bash -claude --plugin-dir ./claude-code-plugin -``` - -Use `/reload-plugins` to pick up changes without restarting. - -## What It Does - -This plugin teaches Claude Code how to use the Major CLI. Once installed, Claude can: - -- Create and clone Major apps -- Start local dev servers -- Deploy to production -- Manage resources and environments -- Handle GitHub invitation flows -- Troubleshoot common issues - -## Usage - -Claude will automatically use the Major skill when you mention Major-related tasks. You can also invoke it directly: - -``` -/major -``` - -## Plugin Structure - -``` -claude-code-plugin/ -├── .claude-plugin/ -│ ├── plugin.json # Plugin manifest -│ └── marketplace.json # Distribution manifest -├── skills/ -│ └── major/ -│ ├── SKILL.md # Main skill -│ └── docs/ # Workflow reference -│ ├── getting-started.md -│ ├── app-workflows.md -│ ├── resource-workflows.md -│ ├── org-management.md -│ └── troubleshooting.md -└── README.md -``` - -## Replaces - -This plugin replaces the MCP server at `mono-builder/apps/mcp-server/`. All documentation, workflow prompts, and system instructions have been migrated to the skill and docs structure. diff --git a/plugins/major/hooks/auto-approve.json b/plugins/major/hooks/auto-approve.json deleted file mode 100644 index 57aaba6..0000000 --- a/plugins/major/hooks/auto-approve.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "hooks": { - "PreToolUse": [ - { - "matcher": "mcp__plugin_major_major-resources__*", - "hooks": [ - { - "type": "command", - "command": "${CLAUDE_PLUGIN_ROOT}/scripts/check-readonly.sh" - } - ] - } - ] - } -} diff --git a/plugins/major/scripts/check-readonly.sh b/plugins/major/scripts/check-readonly.sh deleted file mode 100755 index 312b6df..0000000 --- a/plugins/major/scripts/check-readonly.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# PreToolUse hook that auto-approves read-only MCP tools. -# Reads tool_name from stdin JSON, checks via CLI. - -INPUT=$(cat) -TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty') - -if [ -z "$TOOL_NAME" ]; then - exit 0 -fi - -# Strip the MCP server prefix to get the actual tool name -# e.g., "mcp__plugin_major_major-resources__postgresql_psql" -> "postgresql_psql" -ACTUAL_TOOL=$(echo "$TOOL_NAME" | sed 's/^mcp__plugin_major_major-resources__//') - -major mcp check-readonly "$ACTUAL_TOOL" 2>/dev/null diff --git a/plugins/major/scripts/get-headers.sh b/plugins/major/scripts/get-headers.sh deleted file mode 100755 index 26ecc40..0000000 --- a/plugins/major/scripts/get-headers.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# Find major CLI - check common install locations -MAJOR="" -for p in "$HOME/.major/bin/major" "$HOME/go/bin/major" /usr/local/bin/major; do - [ -x "$p" ] && MAJOR="$p" && break -done -[ -z "$MAJOR" ] && MAJOR=$(PATH="$HOME/.major/bin:$HOME/go/bin:/usr/local/bin:$PATH" command -v major 2>/dev/null) -[ -z "$MAJOR" ] && exit 1 - -TOKEN=$("$MAJOR" user token 2>/dev/null) -ORG=$("$MAJOR" org id 2>/dev/null) -[ -z "$TOKEN" ] || [ -z "$ORG" ] && exit 1 -echo "{\"Authorization\": \"Bearer $TOKEN\", \"x-major-org-id\": \"$ORG\"}" diff --git a/plugins/major/skills/authn b/plugins/major/skills/authn deleted file mode 120000 index 5da37b2..0000000 --- a/plugins/major/skills/authn +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/authn \ No newline at end of file diff --git a/plugins/major/skills/crons b/plugins/major/skills/crons deleted file mode 120000 index c449889..0000000 --- a/plugins/major/skills/crons +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/crons \ No newline at end of file diff --git a/plugins/major/skills/data-table b/plugins/major/skills/data-table deleted file mode 120000 index f843e02..0000000 --- a/plugins/major/skills/data-table +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/data-table \ No newline at end of file diff --git a/plugins/major/skills/major/SKILL.md b/plugins/major/skills/major/SKILL.md deleted file mode 100644 index 06263e3..0000000 --- a/plugins/major/skills/major/SKILL.md +++ /dev/null @@ -1,151 +0,0 @@ ---- -name: major -description: > - Use the Major platform to create, develop, and deploy Next.js web applications. - Triggers when user mentions Major apps, deploying, creating apps, - managing resources, or working with the Major CLI. -disable-model-invocation: false -allowed-tools: Bash(major *), Read(**/plugins/major/skills/major/docs/*) ---- - -# Major Platform - -Major is a platform for building and deploying Next.js web applications. It creates GitHub-backed Next.js apps with local development, connected resources (databases, APIs), and production deployments. - -## Command Reference - -### Application Commands - -| Command | Description | Mode | -|---------|-------------|------| -| `major app create --name "X" --description "Y"` | Create a new app (skips resource selection in non-interactive mode) | Direct | -| `major app clone --app-id "UUID"` | Clone an existing app | Direct | -| `major app start` | Start local dev server (warns if behind origin) | Direct | -| `major app deploy --message "description" --no-wait` | Deploy to production (returns version ID) | Direct | -| `major app deploy-status --version-id "ID"` | Check deployment status (JSON: status, appUrl, error) | Direct | -| `major app list` | List all apps in org (JSON: id, name) | Direct | -| `major app info` | Show app ID, name, deploy status, URL | Direct | -| `major app info --json` | App info as JSON | Direct | -| `major app configure` | Open app settings in browser | Direct | -| `major app logs` | Show recent application logs (newest-first) | Direct | -| `major app logs --since 30m --search "error"` | Filter logs by time window and substring | Direct | -| `major app logs --json` | Output logs as JSON (includes `nextToken` for pagination) | Direct | -| `major app logs --preview` | Read the sandbox dev server's logs | Direct | -| `major app errors list` | List active runtime errors | Direct | -| `major app errors get ` | Inspect an error and its stack trace | Direct | -| `major app errors resolve ` | Mark a confirmed error fixed after committing the fix | Direct | -| `major app errors enable` | Enable runtime error reporting after adding its scaffolding | Direct | -| `major app theme list` | List available themes | Direct | -| `major app theme get` | Read the app's current theme | Direct | -| `major app theme apply ` | Select a theme and write its files into the checkout | Direct | -| `major app ai-proxy status` | Inspect AI proxy configuration and spend | Direct | -| `major app ai-proxy enable` | Enable the proxy with a $10/month limit (ask the user first) | Direct | - -### Environment Variable Commands - -| Command | Description | Mode | -|---------|-------------|------| -| `major vars list` | List env vars for current environment (masked values) | Direct | -| `major vars list --show-values` | List env vars with full values | Direct | -| `major vars list --json` | List env vars as JSON (includes full values) | Direct | -| `major vars get KEY` | Print a single env var's raw value | Direct | -| `major vars get KEY --json` | Print a single env var as JSON | Direct | -| `major vars set KEY=VALUE` | Create or update an env var | Direct | -| `major vars unset KEY` | Remove an env var from current env | Interactive | -| `major vars unset KEY --yes` | Remove an env var without prompting | Direct | -| `major vars unset KEY --all-environments --yes` | Remove an env var from all environments | Direct | -| `major vars pull` | Download env vars to local .env file | Direct | -| `major vars pull --file .env.staging` | Download to a custom file path | Direct | - -Prefer entering secrets through Major's frontend; never ask the user to paste them into chat. Use `major vars set` for known values the user explicitly wants configured. - -All vars commands accept `--env ` to target a specific environment (case-insensitive). Without it, they use the user's currently-selected environment. - -### Resource Commands - -| Command | Description | Mode | -|---------|-------------|------| -| `major resource list` | List org resources as JSON (shows which are attached to app) | Direct | -| `major resource add --id "UUID"` | Add a resource to current app | Direct | -| `major resource remove --id "UUID"` | Remove a resource from current app | Direct | -| `major resource env` | View/switch environments (interactive, or `--id` for non-interactive) | Direct | -| `major resource env-list` | List available environments | Direct | -| `major resource env-list --json` | List environments as JSON | Direct | -| `major resource create` | Open resource creation in browser | Direct | -| `major resource manage` | Interactive resource menu | Interactive | - -### User Commands - -| Command | Description | Mode | -|---------|-------------|------| -| `major user whoami` | Check authentication status | Direct | -| `major user gitconfig` | Configure GitHub username | Direct | -| `major user login` | Authenticate (opens browser) | Interactive | -| `major user logout` | Log out | Direct | - -### Organization Commands - -| Command | Description | Mode | -|---------|-------------|------| -| `major org list` | List all organizations | Direct | -| `major org list --json` | List organizations as JSON (includes IDs) | Direct | -| `major org whoami` | Show current default org | Direct | -| `major org select` | Select default organization | Interactive | -| `major org select --id "UUID"` | Select organization non-interactively | Direct | - -### Other Commands - -| Command | Description | -|---------|-------------| -| `major update` | Update CLI to latest version | -| `major docs` | Open documentation in browser | - -## Rules - -**Direct** commands: Run these yourself via Bash. -**Interactive** commands: Tell the user to run these in their terminal -- they require browser or TUI interaction. - -### Critical Rules - -1. **NEVER use raw git commands** (`git clone`, `git push`) -- always use Major CLI commands. `major app clone` handles GitHub auth, permissions, and `.env` generation. - -2. **Always use `--message` and `--no-wait` with deploy** to skip the interactive commit prompt and avoid TUI issues. The command returns a version ID you can use to check status: - ```bash - major app deploy --message "Add search feature" --no-wait - # Returns version ID, then check status: - major app deploy-status --version-id "" - ``` - On first deploy, also pass `--slug` to set the URL non-interactively: - ```bash - major app deploy --message "Initial deploy" --slug "my-app" --no-wait - ``` - -3. **Always check auth first** before running commands: - ```bash - major user whoami - ``` - -4. **GitHub Invitation Flow** -- When you see "Action Required: Accept GitHub Invitation": - - STOP and tell the user to accept the invitation at the URL shown - - Tell them a browser window should have opened automatically - - After they accept, re-run the same command - - Do NOT try `git clone` directly or retry without user action - -5. **App type**: Creates a Next.js application by default - -6. **Resource management**: Use `major resource list` to see available resources, then `major resource add --id ` or `major resource remove --id ` to manage them programmatically. Use `major resource env-list --json` to see environments and `major resource env --id ` to switch. - -8. **Environment variable management**: Use `major vars` commands to manage env vars. Keys must match `^[A-Za-z_][A-Za-z0-9_]*$` and cannot start with `MAJOR_` (reserved for the platform). Always use `--yes` with `major vars unset` to avoid interactive prompts. Use `major vars pull` to sync env vars to a local `.env` file -- it auto-updates `.gitignore`. - -7. **Organization selection**: Use `major org list --json` to get org IDs, then `major org select --id ` to switch orgs programmatically. - -## Workflow Reference - -For detailed workflows, see the docs below: - -- [Getting Started](docs/getting-started.md) -- Install, auth, first app -- [App Workflows](docs/app-workflows.md) -- Create, clone, start, deploy -- [Env Variables](docs/env-variables.md) -- Set, list, pull, and manage env vars per environment -- [Resource Workflows](docs/resource-workflows.md) -- Create, manage, environments -- [Org Management](docs/org-management.md) -- Organizations and teams -- [Troubleshooting](docs/troubleshooting.md) -- Common issues and fixes diff --git a/plugins/major/skills/major/docs/app-workflows.md b/plugins/major/skills/major/docs/app-workflows.md deleted file mode 100644 index cdeecd8..0000000 --- a/plugins/major/skills/major/docs/app-workflows.md +++ /dev/null @@ -1,120 +0,0 @@ -# App Workflows - -## Creating an App - -```bash -major app create --name "app-name" --description "What this app does" -``` - -**Flags:** -- `--name` -- App name (required for non-interactive use) -- `--description` -- App description (required for non-interactive use) - -**What happens:** -1. API creates the app and a GitHub repository -2. CLI checks GitHub repo access -- may trigger invitation flow -3. Prompts to select resources for the app -4. Clones the repository locally -5. Adds selected resources via major-client -6. Generates `.env` and `.mcp.json` files - -### GitHub Invitation Handling - -If you see this output: -``` -Action Required: Accept GitHub Invitation -https://github.com/Major-Build-Apps/... -After accepting, run this command again. -``` - -**You must:** -1. Tell the user to accept the invitation at the URL shown -2. Tell them a browser window should have opened -3. After acceptance, re-run the same command - -**Never** try `git clone` directly or retry without user action. - -## Cloning an Existing App - -```bash -major app clone --app-id "c21a6147-507a-4b5e-864e-f71c5996cd34" -``` - -Without `--app-id`, the CLI shows an interactive app picker. - -**CRITICAL:** Never use `git clone` directly. `major app clone` handles GitHub authentication, permissions, and generates the required `.env` file. - -## Starting Local Development - -```bash -major app start -``` - -Must be run from the app directory. This: -1. Checks if your branch is behind `origin/main` (warns if so) -2. Generates/refreshes the `.env` file -3. Runs `pnpm install` -4. Runs `pnpm dev` -5. Streams output to the terminal - -The dev server has access to connected resources via environment variables. - -## Deploying to Production - -```bash -major app deploy --message "Add search feature" --no-wait -``` - -Always use `--message` (or `-m`) to skip the interactive commit prompt. Use `--no-wait` to skip the TUI deployment progress tracker (recommended for AI-driven deploys). On first deploy, also pass `--slug` to set the URL non-interactively: - -```bash -major app deploy --message "Initial deployment" --slug "my-app" --no-wait -``` - -**Flags:** -- `--message` / `-m` -- Commit message (skips interactive prompt) -- `--slug` -- URL slug for first deploy (skips interactive prompt) -- `--no-wait` -- Return immediately after triggering deploy (don't wait for completion) - -**What happens:** -1. Checks for uncommitted git changes -2. Stages, commits, and pushes to main branch -3. On first deploy, uses `--slug` or prompts for URL slug -4. Creates application version via API and returns a version ID -5. Without `--no-wait`: shows deployment progress (bundling -> building -> deploying -> deployed) -6. Returns the live app URL on success - -## Checking Deployment Status - -```bash -major app deploy-status --version-id "version-uuid" -``` - -Returns JSON with the current status of a specific deployment version: -```json -{"status":"DEPLOYED","appUrl":"https://my-app.apps2.prod.major.build"} -``` - -Possible statuses: `BUNDLING`, `BUNDLE_FAILED`, `BUILDING`, `BUILD_FAILED`, `DEPLOYING`, `DEPLOY_FAILED`, `DEPLOYED`. - -## Checking App Info - -```bash -major app info -``` - -Displays application ID, name, deploy status, and URL (if deployed). Must be run from within an app directory. - -```bash -major app info --json -``` - -Returns the same info as JSON for programmatic use. - -## Configuring an App - -```bash -major app configure -``` - -Opens the app's settings page in the browser. diff --git a/plugins/major/skills/major/docs/env-variables.md b/plugins/major/skills/major/docs/env-variables.md deleted file mode 100644 index 4996b7f..0000000 --- a/plugins/major/skills/major/docs/env-variables.md +++ /dev/null @@ -1,174 +0,0 @@ -# Environment Variable Workflows - -Environment variables are scoped per-environment (development, staging, production, etc.). Each app can have different values for the same key in different environments. - -## Listing Variables - -```bash -major vars list -``` - -Outputs a table with masked values. First line always shows the active environment. - -```bash -major vars list --show-values -``` - -Reveals full values. - -```bash -major vars list --json -``` - -JSON output with full values -- suitable for scripting. - -### Targeting a Specific Environment - -All vars commands except `request` accept `--env ` (case-insensitive): - -```bash -major vars list --env staging -major vars list --env Production -``` - -Without `--env`, commands use the user's currently-selected environment (set via `major resource env`). - -## Getting a Single Variable - -```bash -major vars get DATABASE_URL -``` - -Prints the raw value to stdout with no prefix -- suitable for shell use: - -```bash -export DB=$(major vars get DATABASE_URL) -``` - -Returns exit code 1 if the key does not exist or has no value in the target environment. - -```bash -major vars get DATABASE_URL --json -``` - -Wraps the result as `{"key":"...","value":"...","environment":"..."}`. - -## Setting Variables - -```bash -major vars set DATABASE_URL=postgres://localhost/mydb -``` - -Creates or updates the value for the current environment only. Other environments are not affected. - -The argument is split on the **first** `=`, so values can contain `=`: - -```bash -major vars set 'CONNECTION_STRING=host=db;port=5432;user=app' -``` - -### Key Rules - -- Must match `^[A-Za-z_][A-Za-z0-9_]*$` -- Cannot start with `MAJOR_` (reserved for platform-managed variables) -- Setting is idempotent -- running the same command again is a no-op - -### Setting for a Specific Environment - -```bash -major vars set DATABASE_URL=postgres://staging-db/app --env staging -``` - -## Removing Variables - -```bash -major vars unset SECRET_KEY --yes -``` - -Removes the value for the current environment only. The key still exists if other environments have values. - -```bash -major vars unset SECRET_KEY --all-environments --yes -``` - -Removes the key across every environment. - -Always pass `--yes` in automated/agentic contexts to skip the confirmation prompt. - -## Pulling Variables to a Local File - -```bash -major vars pull -``` - -Writes all variables (user-defined and platform `MAJOR_*` vars) to `.env` in dotenv format. Automatically adds `.env` to `.gitignore` if it is not already ignored. - -```bash -major vars pull --file .env.staging --env staging -``` - -Writes to a custom file and targets a specific environment. Note: `--env` with pull temporarily switches your active environment to fetch the correct values. - -### File Format - -```bash -# Pulled from Major "development" environment at 2026-04-13T10:00:00Z -# Do not edit MAJOR_* variables - they are managed by the platform - -DATABASE_URL=postgres://localhost/mydb -STRIPE_SECRET_KEY="sk_test_abc123" - -MAJOR_API_BASE_URL=https://api.major.build -MAJOR_JWT_TOKEN="eyJ..." -``` - -User-defined keys are sorted alphabetically first, followed by `MAJOR_*` system vars. Values containing special characters (`$`, `#`, spaces, quotes, newlines) are double-quoted with proper escaping. - -## Listing Available Environments - -Before targeting a specific environment with `--env`, you can see what's available: - -```bash -major resource env-list -``` - -Or as JSON (useful for scripting): - -```bash -major resource env-list --json -``` - -To switch your active environment interactively: - -```bash -major resource env -``` - -Or non-interactively by ID: - -```bash -major resource env --id "" -``` - -## Common Patterns - -### Set Up a New Environment Locally - -```bash -major resource env --id "" # switch to staging -major vars pull # download vars -major app start # start dev server -``` - -### Copy a Variable Across Environments - -```bash -VALUE=$(major vars get API_KEY --env production) -major vars set "API_KEY=$VALUE" --env staging -``` - -### Check What's Set Before Deploying - -```bash -major vars list --env production --show-values -``` diff --git a/plugins/major/skills/major/docs/getting-started.md b/plugins/major/skills/major/docs/getting-started.md deleted file mode 100644 index 50463fd..0000000 --- a/plugins/major/skills/major/docs/getting-started.md +++ /dev/null @@ -1,76 +0,0 @@ -# Getting Started with Major - -## Prerequisites - -1. **Node.js** >= 22.0.0 -2. **pnpm** installed globally - -## Install the Major CLI - -```bash -curl -fsSL https://install.major.build | bash -``` - -## Authenticate - -Authentication is interactive -- the user must run this in their terminal: - -```bash -major user login -``` - -This opens a browser for OAuth authentication, then prompts for default organization selection. Credentials are stored securely in the system keychain. - -## Verify Authentication - -```bash -major user whoami -``` - -Returns the logged-in email and default organization. - -## Configure GitHub Username - -```bash -major user gitconfig -``` - -Stores the GitHub username in the keychain for app creation. This is auto-detected from SSH config in most cases. - -## Create Your First App - -```bash -major app create --name "my-app" --description "My first Major app" -``` - -This will: -1. Create the app and GitHub repository (Next.js by default) -2. Ensure GitHub repo access (may trigger invitation flow) -3. Clone the repository locally -4. Generate `.env` file with environment variables -5. Generate `.mcp.json` for Claude Code integration - -## Start Development - -```bash -cd my-app -major app start -``` - -This checks for upstream changes, runs `pnpm install` followed by `pnpm dev`, starting a local dev server with access to connected resources via environment variables. - -## Deploy to Production - -```bash -major app deploy --message "Initial deployment" --no-wait -``` - -Always include `--message` to skip the interactive commit prompt. Use `--no-wait` to skip the TUI progress tracker. The CLI stages, commits, pushes, and deploys automatically. - -## Check App Status - -```bash -major app info -``` - -Shows app ID, name, deploy status, and URL (if deployed). diff --git a/plugins/major/skills/major/docs/org-management.md b/plugins/major/skills/major/docs/org-management.md deleted file mode 100644 index 452f57b..0000000 --- a/plugins/major/skills/major/docs/org-management.md +++ /dev/null @@ -1,48 +0,0 @@ -# Organization Management - -Organizations group users, apps, and resources. Each user can belong to multiple organizations. - -## List Organizations - -```bash -major org list -``` - -Lists all organizations the user belongs to. The default org is marked. - -```bash -major org list --json -``` - -Returns JSON with org IDs for programmatic use: -```json -[{"id":"uuid","name":"My Org","isSelected":true}] -``` - -## Show Current Organization - -```bash -major org whoami -``` - -Displays the currently selected default organization. - -## Select Default Organization - -### Non-interactive (recommended for AI) - -```bash -major org select --id "organization-uuid" -``` - -Selects the default organization by ID. Use `major org list --json` to get the ID. - -### Interactive - -```bash -major org select -``` - -Opens a TUI picker for selecting the default organization. The user must run this in their terminal. - -The default organization determines which org's apps and resources are shown when running other commands. The selection is stored in the system keychain. diff --git a/plugins/major/skills/major/docs/resource-workflows.md b/plugins/major/skills/major/docs/resource-workflows.md deleted file mode 100644 index 8acb4d7..0000000 --- a/plugins/major/skills/major/docs/resource-workflows.md +++ /dev/null @@ -1,115 +0,0 @@ -# Resource Workflows - -Resources are external services (databases, APIs, storage) that can be connected to Major applications. They are managed at the organization level and shared across apps. - -## What Are Resources? - -- **Databases**: PostgreSQL, MongoDB, CosmosDB, etc. -- **APIs**: Internal company APIs, third-party services -- **Storage**: Blob storage, file systems -- **Other**: Message queues, caches, etc. - -## Creating a Resource - -```bash -major resource create -``` - -Opens the resource creation page in the browser. Resources are created at the organization level. - -## Listing Resources - -```bash -major resource list -``` - -Lists all resources in the organization as JSON. Each resource includes `isAttached` to show if it's connected to the current app. Example output: - -```json -[{"id":"uuid","name":"My DB","type":"postgresql","description":"Production database","isAttached":true}] -``` - -## Adding a Resource to an App - -```bash -major resource add --id "resource-uuid" -``` - -Adds a resource to the current application by ID. This: -1. Updates the app's resource list on the server -2. Generates the local client code via `major-client` -3. Installs dependencies - -Use `major resource list` to find the resource ID. - -## Removing a Resource from an App - -```bash -major resource remove --id "resource-uuid" -``` - -Removes a resource from the current application. This: -1. Updates the app's resource list on the server -2. Removes the local client code - -## Managing Resources (Interactive) - -```bash -major resource manage -``` - -This is **interactive** -- the user must run it in their terminal. It opens a TUI menu to: -- View connected resources -- Connect new resources to the app -- Disconnect resources - -## Environment Switching - -### List Environments - -```bash -major resource env-list -major resource env-list --json -``` - -Lists available environments. With `--json`, outputs: -```json -[{"id":"uuid","name":"production","isCurrent":true}] -``` - -### Switch Environment - -```bash -major resource env --id "environment-uuid" -``` - -Switches to a specific environment non-interactively. - -```bash -major resource env -``` - -Without `--id`, opens an interactive TUI picker. - -Resources can be configured differently per environment (dev, staging, production). - -## How Resources Work in Code - -When you run `major app start`, environment variables are automatically injected for all connected resources. Your code accesses them via `process.env`: - -```javascript -// Example: PostgreSQL connection -const dbUrl = process.env.DATABASE_URL; -``` - -The `.env` file is generated and refreshed automatically by `major app start` and `major app clone`. - -## Adding Resources During App Creation - -When creating an app with `major app create`, the CLI prompts to select resources. This connects them immediately and includes their environment variables in the generated `.env` file. - -## Adding Resources After Creation - -1. List available resources: `major resource list` -2. Add by ID: `major resource add --id "resource-uuid"` -3. Restart the dev server with `major app start` to pick up new environment variables diff --git a/plugins/major/skills/major/docs/troubleshooting.md b/plugins/major/skills/major/docs/troubleshooting.md deleted file mode 100644 index 25508fb..0000000 --- a/plugins/major/skills/major/docs/troubleshooting.md +++ /dev/null @@ -1,110 +0,0 @@ -# Troubleshooting - -## Authentication Issues - -**"Not authenticated" or login errors** -```bash -major user login -``` -User must run this in their terminal -- it opens a browser for OAuth. - -**Session expired** -Run `major user login` again to refresh the token. - -**Check current auth status** -```bash -major user whoami -``` - -## Application Issues - -**"Not in an application directory"** -Navigate to the app directory. Verify with `major app info`. - -**Can't find my app** -Use `major app clone` to list and clone available apps. - -**Missing `.env` file** -Run `major app start` -- it regenerates the `.env` file automatically. - -**Branch behind origin** -`major app start` warns if your branch is behind `origin/main`. Run `git pull` to update. - -## Resource Issues - -**Resources not available locally** -1. Check connected resources: `major resource list` -2. Verify environment: `major resource env-list` -3. Restart dev server: `major app start` (regenerates `.env`) - -**Wrong environment** -```bash -major resource env-list --json -major resource env --id "correct-env-id" -``` -Switch to the correct environment, then restart the dev server. - -**Adding/removing resources programmatically** -```bash -major resource list # See available resources and their IDs -major resource add --id "resource-id" # Add to current app -major resource remove --id "resource-id" # Remove from current app -``` - -## Deployment Issues - -**Deploy crashes or hangs** -Use `--no-wait` to skip the TUI progress tracker: -```bash -major app deploy --message "description" --no-wait -``` - -**Deploy fails** -1. Check authentication: `major user whoami` -2. Verify app directory: `major app info` -3. Test locally first: `major app start` -4. Check build output for syntax or import errors - -**"Not in a git repository"** -Navigate to the app directory. Major apps are git repositories. - -## Organization Issues - -**Switch organizations programmatically** -```bash -major org list --json # Get org IDs -major org select --id "org-id" # Switch to a specific org -``` - -## CLI Issues - -**CLI out of date** -```bash -major update -``` -Auto-detects install method (brew or direct) and updates. - -**Command not found** -Reinstall the CLI: -```bash -curl -fsSL https://install.major.build | bash -``` - -## GitHub Issues - -**Invitation not accepted** -When you see "Action Required: Accept GitHub Invitation": -1. Open the URL shown in the output -2. Accept the invitation on GitHub -3. Re-run the original command - -**Permission denied on clone** -Never use `git clone` directly. Use `major app clone --app-id "UUID"` which handles authentication and permissions. - -## Getting More Help - -```bash -major docs # Opens documentation in browser -major --help # Show all commands -major app --help # Show app subcommands -``` diff --git a/plugins/major/skills/memory b/plugins/major/skills/memory deleted file mode 120000 index e60e186..0000000 --- a/plugins/major/skills/memory +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/memory \ No newline at end of file diff --git a/plugins/major/skills/resources_ai-proxy b/plugins/major/skills/resources_ai-proxy deleted file mode 120000 index f64372e..0000000 --- a/plugins/major/skills/resources_ai-proxy +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_ai-proxy \ No newline at end of file diff --git a/plugins/major/skills/resources_attio/SKILL.md b/plugins/major/skills/resources_attio/SKILL.md deleted file mode 100644 index 6cc1640..0000000 --- a/plugins/major/skills/resources_attio/SKILL.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -name: using-attio-connector -description: Implements Attio CRM data access for people, companies, lists, notes, and tasks using generated clients and MCP tools. Use when doing ANYTHING that touches Attio in any way, load this skill. ---- - -# Major Platform Resource: Attio - -## Common: Interacting with Resources - -**Security**: Never connect directly to databases/APIs. Never use credentials in code. Always use generated clients or MCP tools. - -**Three ways to interact with Attio:** - -1. **MCP tools** (direct, no code needed): Tools follow the pattern `mcp__resources___`. Use `mcp__resources__list_resources` to discover available resources and their IDs. -2. **Generated TypeScript clients** (for app code): Call `mcp__resource-tools__add-resource-client` with a `resourceId` to generate a typed client. Clients are created in `/clients/` (Next.js) or `/src/clients/` (Vite). -3. **HTTP proxy** (Next.js apps): Use `createProxyFetch` from `@major-tech/resource-client/next` to call the Attio API directly with automatic auth injection. See [using-http-proxy](../../shared/skills/http-proxy/SKILL.md) for setup and usage — preferred when you need to hit endpoints not covered by MCP tools or the typed client, or when using an official SDK that accepts a custom `fetch`. - -**CRITICAL: Do NOT guess client method names or signatures.** After generating a client, ALWAYS read the generated client file to discover the exact API. Different resource types have completely different methods and calling conventions. - -**Invocation keys** must be static string literals (e.g., `"list-objects"`). Never use dynamic values like template literals, variables, or `.toString()`. - ---- - -## MCP Tools - -- `mcp__resources__attio_get` — Make a GET request to any Attio API endpoint. Args: `resourceId`, `path`, `query?` -- `mcp__resources__attio_list_objects` — List all CRM objects in the workspace. Args: `resourceId` -- `mcp__resources__attio_list_records` — Query records for a specific object with optional filtering. Args: `resourceId`, `objectSlug`, `filter?`, `sorts?`, `limit?` -- `mcp__resources__attio_list_lists` — List all lists in the workspace. Args: `resourceId` -- `mcp__resources__attio_invoke` — Make any HTTP request to the Attio API (including writes). Args: `resourceId`, `method`, `path`, `query?`, `body?`, `timeoutMs?` - -## TypeScript Client - -The Attio client uses a **flattened JSON response** (like Stripe). Check `.ok`, then access `.json` directly — no need to dig through `result.body.kind`. - -```typescript -import { attioClient } from "./clients"; - -// invoke(method, path, invocationKey, options?) -const result = await attioClient.invoke<{ data: Array<{ id: { object_id: string } }> }>( - "GET", "/v2/objects", "list-objects" -); -if (result.ok) { - const objects = result.json.data; // Typed as the generic T -} - -// POST with body — create a person record -const createResult = await attioClient.invoke("POST", "/v2/objects/people/records", "create-person", { - body: { type: "json", value: { data: { values: { name: [{ first_name: "Jane", last_name: "Doe" }] } } } }, -}); -if (createResult.ok) { - console.log("Created:", createResult.json); -} - -// Query records with filter -const queryResult = await attioClient.invoke("POST", "/v2/objects/companies/records/query", "query-companies", { - body: { type: "json", value: { limit: 10 } }, -}); -``` - ---- - -## Tips - -- **Attio API base URL**: `https://api.attio.com` — all paths start with `/v2/` -- **Standard objects**: `people`, `companies`, `deals`, `workspaces` — use slugs not IDs for standard objects -- **Record queries** use POST to `/v2/objects/{slug}/records/query` with filter/sort in the body -- **Pagination**: Use `offset` and `limit` params. Default limit is 25, max is 500. -- **Rate limits**: Attio uses a token bucket approach. Check `X-RateLimit-Remaining` header. -- Response structure with the flattened client: `{ ok: true, status: number, json: T }` — no nested body parsing needed. - -**Docs**: [Attio REST API Reference](https://docs.attio.com/rest-api/overview) diff --git a/plugins/major/skills/resources_bigquery b/plugins/major/skills/resources_bigquery deleted file mode 120000 index fbd0014..0000000 --- a/plugins/major/skills/resources_bigquery +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_bigquery \ No newline at end of file diff --git a/plugins/major/skills/resources_cosmosdb b/plugins/major/skills/resources_cosmosdb deleted file mode 120000 index 9639d1f..0000000 --- a/plugins/major/skills/resources_cosmosdb +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_cosmosdb \ No newline at end of file diff --git a/plugins/major/skills/resources_custom-api b/plugins/major/skills/resources_custom-api deleted file mode 120000 index 4f7dcdb..0000000 --- a/plugins/major/skills/resources_custom-api +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_custom-api \ No newline at end of file diff --git a/plugins/major/skills/resources_dynamodb b/plugins/major/skills/resources_dynamodb deleted file mode 120000 index 9824eac..0000000 --- a/plugins/major/skills/resources_dynamodb +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_dynamodb \ No newline at end of file diff --git a/plugins/major/skills/resources_github b/plugins/major/skills/resources_github deleted file mode 120000 index 6746c67..0000000 --- a/plugins/major/skills/resources_github +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_github \ No newline at end of file diff --git a/plugins/major/skills/resources_google-analytics b/plugins/major/skills/resources_google-analytics deleted file mode 120000 index 6f96536..0000000 --- a/plugins/major/skills/resources_google-analytics +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_google-analytics \ No newline at end of file diff --git a/plugins/major/skills/resources_googlesheets b/plugins/major/skills/resources_googlesheets deleted file mode 120000 index c0ee0a7..0000000 --- a/plugins/major/skills/resources_googlesheets +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_googlesheets \ No newline at end of file diff --git a/plugins/major/skills/resources_graphql b/plugins/major/skills/resources_graphql deleted file mode 120000 index 51b88bf..0000000 --- a/plugins/major/skills/resources_graphql +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_graphql \ No newline at end of file diff --git a/plugins/major/skills/resources_hubspot b/plugins/major/skills/resources_hubspot deleted file mode 120000 index aa09b2d..0000000 --- a/plugins/major/skills/resources_hubspot +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_hubspot \ No newline at end of file diff --git a/plugins/major/skills/resources_lambda b/plugins/major/skills/resources_lambda deleted file mode 120000 index 0e1ab8a..0000000 --- a/plugins/major/skills/resources_lambda +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_lambda \ No newline at end of file diff --git a/plugins/major/skills/resources_list-resources b/plugins/major/skills/resources_list-resources deleted file mode 120000 index 43e78f0..0000000 --- a/plugins/major/skills/resources_list-resources +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_list-resources \ No newline at end of file diff --git a/plugins/major/skills/resources_majorauth b/plugins/major/skills/resources_majorauth deleted file mode 120000 index 48b7223..0000000 --- a/plugins/major/skills/resources_majorauth +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_majorauth \ No newline at end of file diff --git a/plugins/major/skills/resources_managed-database b/plugins/major/skills/resources_managed-database deleted file mode 120000 index 08a7596..0000000 --- a/plugins/major/skills/resources_managed-database +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_managed-database \ No newline at end of file diff --git a/plugins/major/skills/resources_mcp_custom b/plugins/major/skills/resources_mcp_custom deleted file mode 120000 index 86757d7..0000000 --- a/plugins/major/skills/resources_mcp_custom +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_mcp_custom \ No newline at end of file diff --git a/plugins/major/skills/resources_mssql b/plugins/major/skills/resources_mssql deleted file mode 120000 index f740690..0000000 --- a/plugins/major/skills/resources_mssql +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_mssql \ No newline at end of file diff --git a/plugins/major/skills/resources_neo4j b/plugins/major/skills/resources_neo4j deleted file mode 120000 index 0a16af6..0000000 --- a/plugins/major/skills/resources_neo4j +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_neo4j \ No newline at end of file diff --git a/plugins/major/skills/resources_outreach b/plugins/major/skills/resources_outreach deleted file mode 120000 index 16e57bb..0000000 --- a/plugins/major/skills/resources_outreach +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_outreach \ No newline at end of file diff --git a/plugins/major/skills/resources_postgresql b/plugins/major/skills/resources_postgresql deleted file mode 120000 index dafaeb7..0000000 --- a/plugins/major/skills/resources_postgresql +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_postgresql \ No newline at end of file diff --git a/plugins/major/skills/resources_quickbooks b/plugins/major/skills/resources_quickbooks deleted file mode 120000 index 88d0330..0000000 --- a/plugins/major/skills/resources_quickbooks +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_quickbooks \ No newline at end of file diff --git a/plugins/major/skills/resources_s3 b/plugins/major/skills/resources_s3 deleted file mode 120000 index eb04db5..0000000 --- a/plugins/major/skills/resources_s3 +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_s3 \ No newline at end of file diff --git a/plugins/major/skills/resources_salesforce b/plugins/major/skills/resources_salesforce deleted file mode 120000 index b80b034..0000000 --- a/plugins/major/skills/resources_salesforce +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_salesforce \ No newline at end of file diff --git a/plugins/major/skills/resources_slack b/plugins/major/skills/resources_slack deleted file mode 120000 index b60b184..0000000 --- a/plugins/major/skills/resources_slack +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_slack \ No newline at end of file diff --git a/plugins/major/skills/resources_snowflake b/plugins/major/skills/resources_snowflake deleted file mode 120000 index f97a7a2..0000000 --- a/plugins/major/skills/resources_snowflake +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_snowflake \ No newline at end of file diff --git a/plugins/major/skills/resources_sqs b/plugins/major/skills/resources_sqs deleted file mode 120000 index 8e47abf..0000000 --- a/plugins/major/skills/resources_sqs +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/resources_sqs \ No newline at end of file diff --git a/plugins/major/skills/webhooks b/plugins/major/skills/webhooks deleted file mode 120000 index 72d6052..0000000 --- a/plugins/major/skills/webhooks +++ /dev/null @@ -1 +0,0 @@ -../../shared/skills/webhooks \ No newline at end of file