ai-universe-auth
Authenticate with AI Universe MCP server for multi-model commands
What this skill does
# AI Universe Authentication Setup This skill provides authentication setup for the AI Universe MCP server, which powers the `/secondo` command for multi-model AI feedback. ## Script Location **IMPORTANT:** Always look for `auth-cli.mjs` in these locations (in order of preference): | Location | Description | Has node_modules | |----------|-------------|------------------| | `scripts/auth-cli.mjs` | Project-local (recommended) | Needs parent project | | `~/.claude/scripts/auth-cli.mjs` | User-global fallback | Yes (if installed) | | `~/projects/ai_universe/scripts/auth-cli.mjs` | Source of truth | Yes | **To run the script**, use a directory that has `node_modules` with `express` installed: ```bash # From ai_universe project (always works) cd ~/projects/ai_universe && node scripts/auth-cli.mjs status # Or from ~/.claude if deps installed node ~/.claude/scripts/auth-cli.mjs status ``` ## Multi-Project Support The script supports **two Firebase projects**. Use the correct one for your use case: | Project | Firebase ID | Use Case | Command | |---------|-------------|----------|---------| | **AI Universe** | `ai-universe-b3551` | `/secondo`, multi-model synthesis | `node scripts/auth-cli.mjs token` (default) | | **WorldAI** | `worldarchitecture-ai` | WorldArchitect.AI app auth | `node scripts/auth-cli.mjs token --project worldarchitecture-ai` | ### When to Use Each Project #### AI Universe (`ai-universe-b3551`) - DEFAULT - `/secondo` command for multi-model second opinions - AI Universe MCP server calls - Multi-model synthesis API ```bash # Default - no flag needed node scripts/auth-cli.mjs login node scripts/auth-cli.mjs token ``` #### WorldAI (`worldarchitecture-ai`) - WorldArchitect.AI application authentication - Firebase auth for the RPG game platform - Direct WorldAI API calls ```bash # Explicit project flag required node scripts/auth-cli.mjs login --project worldarchitecture-ai node scripts/auth-cli.mjs token --project worldarchitecture-ai ``` ## Prerequisites - Node.js (>=20.0.0) installed - Express dependency installed (`npm install express`) - Browser for OAuth flow ## Authentication Flow ### 1. Initial Login ```bash # AI Universe (default) - for /secondo node scripts/auth-cli.mjs login # WorldAI - for WorldArchitect.AI node scripts/auth-cli.mjs login --project worldarchitecture-ai ``` **What happens:** - Starts local callback server on port 9005 - Opens browser to Firebase Google sign-in - User signs in with Google account - ID token and refresh token saved to `~/.ai-universe/auth-token-<project-id>.json` - ID token expires after 1 hour (Firebase security policy) - Refresh token enables automatic token renewal ### 2. Check Authentication Status ```bash node scripts/auth-cli.mjs status ``` **Output includes:** - User information (name, email, UID) - Firebase Project being used - Token creation time - Token expiration time - Current validity status ### 3. Get Token for Scripts ```bash # Get token (auto-refreshes if expired, does nothing if valid) TOKEN=$(node scripts/auth-cli.mjs token) echo $TOKEN # For WorldAI project TOKEN=$(node scripts/auth-cli.mjs token --project worldarchitecture-ai) ``` **Token Behavior:** - **Token Valid**: Returns it immediately - **Token Expired**: Auto-refreshes using refresh token (silent, no browser popup) - **Refresh Token Expired**: Prompts for login (browser OAuth) This enables seamless 30+ day sessions. ### 4. Manual Token Refresh ```bash node scripts/auth-cli.mjs refresh ``` ### 5. Test MCP Connection ```bash node scripts/auth-cli.mjs test ``` ### 6. Logout ```bash node scripts/auth-cli.mjs logout ``` ## Troubleshooting ### Script Not Found or Missing Dependencies ```bash # Option 1: Run from ai_universe project cd ~/projects/ai_universe && node scripts/auth-cli.mjs status # Option 2: Install deps in ~/.claude cd ~/.claude && npm install express # Option 3: Copy working script cp ~/projects/ai_universe/scripts/auth-cli.mjs ~/.claude/scripts/ ``` ### PROJECT_NUMBER_MISMATCH Error This means the token was created for a different Firebase project than you're trying to use. ```bash # Check which project your token is for node scripts/auth-cli.mjs status # Look for "Firebase Project:" line # Re-login for the correct project node scripts/auth-cli.mjs login # AI Universe node scripts/auth-cli.mjs login --project worldarchitecture-ai # WorldAI ``` ### Port 9005 Already in Use ```bash lsof -ti:9005 | xargs kill -9 ``` ### Token Expired ```bash # Auto-refresh (silent) TOKEN=$(node scripts/auth-cli.mjs token) # Or manual refresh node scripts/auth-cli.mjs refresh # If refresh token expired, re-login node scripts/auth-cli.mjs login ``` ## Token Storage - **Location**: `~/.ai-universe/auth-token-<project-id>.json` (separate file per project) - **ID Token**: 1-hour expiration (Firebase policy) - **Refresh Token**: ~30 days, enables silent renewal - **Security**: Never commit tokens, localhost OAuth only ## Integration with Commands | Command | Project | Authentication | |---------|---------|----------------| | `/secondo` | AI Universe | `node scripts/auth-cli.mjs token` (default) | | WorldAI API | WorldAI | `node scripts/auth-cli.mjs token --project worldarchitecture-ai` | ## Keeping Scripts in Sync The source of truth for `auth-cli.mjs` is `~/projects/ai_universe/scripts/auth-cli.mjs`. To sync to other locations: ```bash # Sync to project .claude/scripts/ cp ~/projects/ai_universe/scripts/auth-cli.mjs .claude/scripts/ # Sync to user ~/.claude/scripts/ cp ~/projects/ai_universe/scripts/auth-cli.mjs ~/.claude/scripts/ ``` ## Related Skills - [ai-universe-httpie.md](ai-universe-httpie.md) - HTTPie usage examples - [secondo-dependencies.md](secondo-dependencies.md) - /secondo command dependencies
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.