analyze-repo
Analyze an existing repository's structure, conventions, and guardrails.
Full dynamic analysis of workspace topology, dependencies, and contracts.
$ npx -y skills add alinaqi/maggy --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/analyze-workspaceContext preview
What this command does when you run it.
Full dynamic analysis of workspace topology, dependencies, and contracts.
> Full dynamic analysis of workspace topology, dependencies, and contracts.
Run this command when:
๐ Analyzing workspace topology... Checking workspace indicators: โ Found turbo.json (Turborepo) โ Found pnpm-workspace.yaml โ No nx.json โ No lerna.json Workspace type: Monorepo (Turborepo) Root: /Users/ali/code/myapp Discovering modules... โ apps/web (package.json found) โ apps/api (pyproject.toml found) โ packages/shared-types (package.json found) โ packages/db (package.json found) Modules found: 4
For each module, analyze:
๐ฆ Analyzing apps/web... Tech stack: Next.js 14, TypeScript, TailwindCSS Entry point: src/app/layout.tsx Key directories: src/lib/, src/components/, src/types/ Dependencies: @repo/shared-types, @repo/ui External calls: fetch โ apps/api (15 files) Token estimate: 18K full, 5K summarized ๐ฆ Analyzing apps/api... Tech stack: FastAPI, Python 3.12, SQLAlchemy Entry point: app/main.py Key directories: app/routes/, app/schemas/, app/models/ Dependencies: packages/db (internal) Exposes: OpenAPI spec (47 endpoints) Token estimate: 24K full, 7K summarized ๐ฆ Analyzing packages/shared-types... Tech stack: TypeScript Entry point: src/index.ts Exports: 34 types Consumed by: apps/web, apps/api (codegen) Token estimate: 3K ๐ฆ Analyzing packages/db... Tech stack: Drizzle ORM, TypeScript Entry point: src/index.ts Tables: 12 Migrations: 23 Token estimate: 8K full, 2K schema only
๐ Extracting contracts... OpenAPI Detection: โ apps/api/openapi.json (47 endpoints, 23 schemas) GraphQL Detection: โ No GraphQL schemas found TypeScript Types: โ packages/shared-types/src/index.ts (34 exports) Pydantic Schemas: โ apps/api/app/schemas/ (23 models) Database Schema: โ packages/db/schema/ (12 tables) Contract sources registered: 5 files
๐ Building dependency graph... Internal dependencies: apps/web โ packages/shared-types (23 imports) apps/web โ apps/api (15 API calls) apps/api โ packages/db (12 imports) apps/api โ packages/shared-types (codegen) packages/db โ (none) packages/shared-types โ (none) Dependency order (for changes): 1. packages/shared-types (leaf) 2. packages/db (leaf) 3. apps/api (depends on db, shared-types) 4. apps/web (depends on api, shared-types)
๐ Identifying key files... High priority (always relevant): โ apps/api/openapi.json โ packages/shared-types/src/index.ts โ apps/web/src/lib/api/client.ts Context-specific: โ API work: apps/api/app/routes/*.py โ DB work: packages/db/schema/*.ts โ Auth work: apps/api/app/routes/auth.py + deps โ Frontend: apps/web/src/components/** Token budget by context: Frontend API: ~8K tokens Backend endpoints: ~12K tokens Database changes: ~6K tokens Shared types: ~4K tokens
๐ Generating workspace artifacts... Created: โ _project_specs/workspace/TOPOLOGY.md โ _project_specs/workspace/CONTRACTS.md โ _project_specs/workspace/DEPENDENCY_GRAPH.md โ _project_specs/workspace/KEY_FILES.md โ _project_specs/workspace/CROSS_REPO_INDEX.md โ _project_specs/workspace/.contract-sources
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ WORKSPACE ANALYSIS COMPLETE โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Workspace: myapp Type: Monorepo (Turborepo) Modules: 4 (2 apps, 2 packages) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ apps/web (Next.js) โโโโโ apps/api (FastAPI) โ โ โ โ โ โ โผ โผ โ โ packages/shared-types packages/db โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Contracts: REST API: 47 endpoints Shared types: 34 interfaces DB tables: 12 Token Estimates: Current module only: ~20K tokens With cross-module context: ~45K tokens Full workspace: ~53K tokens Budget remaining: ~100K tokens โ Artifacts generated in: _project_specs/workspace/ Next steps: โข Contracts will auto-sync on commit (if changed) โข Run /sync-contracts manually to refresh โข Run /workspace-status for quick check โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Flag | Description | |------|-------------| | `--force` | Regenerate all artifacts even if recent | | `--type <type>` | Override auto-detection: `monorepo`, `multi-repo`, `hybrid` | | `--repos <paths>` | For multi-repo: comma-separated paths to related repos | | `--skip-contracts` | Skip contract extraction (faster) | | `--verbose` | Show detailed analysis output | | `--json` | Output as JSON (for tooling) |
For workspaces with separate git repositories:
# Auto-detect sibling repos /analyze-workspace --type multi-repo # Specify repo locations explicitly /analyze-workspace --type multi-repo --repos "../backend,../shared,../mobile"
Claude will: 1. Detect related repos in parent directory 2. Set up symlinks in `.workspace/repos/` if needed 3. Analyze each repo 4. Build cross-repo dependency graph 5. Extract contracts from each
Creates the full workspace context structure:
_project_specs/
โโโ workspace/
โโโ TOPOLOGY.md
โโโ CONTRACTS.md
โโโ DEPENDENCY_GRAPH.md
โโโ KEY_FILES.md
โโโ CROSS_REPO_INDEX.md
โโโ .contract-sources
โโโ cache/ # Cached cross-repo filesAd
Turn Claude Code into a self-reviewing, test-enforced engineering system that remembers context across sessions โ then route work across 13 models from a single dashboard.
Repo: alinaqi/maggy
Analyze an existing repository's structure, conventions, and guardrails.
Build-in-Public โ generate posts from your engineering work, anonymize, and schedule via Buffer
Checks who's working on the project and optionally converts to a multi-person project with team state management.
Infer ReasonNodes from existing git commit history. One-time setup for existing codebases.
Run a full drift scan and display all unresolved drift events, grouped by dimension and sorted by severity.
Show the blast radius of a ReasonNode or symbol โ what depends on it, what breaks if it changes.