Get the FREE Ultimate OpenClaw Setup Guide →

mags-setup

npx machina-cli add skill doancan/mags/mags-setup --openclaw
Files (1)
SKILL.md
3.7 KB

MAGS Setup

Analyze the current project and recommend an optimal setup for Claude Code workflows.

Steps

1. Analyze project

Gather project signals in parallel:

  • Read .mags/config.yaml to check for a locale field. If present, use this locale value when calling mags_create_doc and mags_scaffold_module throughout this flow.
  • Call mags_project_summary for overall context.
  • Use Glob to detect project type:
    • package.json — Node/JS project
    • Cargo.toml — Rust project
    • go.mod — Go project
    • pyproject.toml or requirements.txt — Python project
    • pom.xml or build.gradle — Java project
    • *.sln or *.csproj — .NET project
  • Use Glob to detect frameworks and tools:
    • next.config.* — Next.js
    • nest-cli.json or src/main.ts with NestJS imports — NestJS
    • prisma/schema.prisma — Prisma ORM
    • docker-compose.* — Docker
    • .github/workflows/ — GitHub Actions CI
    • tailwind.config.* — Tailwind CSS
  • Read package.json or equivalent manifest for dependencies.

2. Recommend skills and agents

Based on the detected stack, recommend Claude Code slash commands and workflows. Present as a checklist:

== Recommended Setup for <project name> ==

Detected: <framework> + <language> + <key tools>

SKILLS (slash commands to install)
  [x] /commit        — You have this (from MAGS)
  [ ] /review-pr     — PR review automation
  [ ] /test          — Test generation for <framework>
  [ ] /deploy        — Deploy workflow for <detected CI>

HOOKS (automation triggers)
  [ ] pre-commit     — Lint + typecheck before commit
  [ ] post-save      — Auto-format on save
  [ ] pre-push       — Run tests before push

MCP SERVERS
  [ ] mags           — Already active
  [ ] <db tool>      — Database introspection for <detected DB>
  [ ] <api tool>     — API testing for <detected framework>

Mark items already present with [x]. Only recommend what makes sense for the detected stack.

3. Audit CLAUDE.md

Call mags_audit_claude_md to check the current CLAUDE.md (if it exists) against the project's actual state.

Display findings:

CLAUDE.md AUDIT
  Status:    <exists / missing / outdated>
  Coverage:  <what's covered vs what's missing>
  Issues:
    - <specific issue>
    - <specific issue>

4. Offer actions

Present actionable next steps:

"I can help with any of these:"

  1. Generate/update CLAUDE.md -- Create or refresh based on current project state
  2. Scaffold a module -- Set up a new module with docs, tests, and structure
  3. Install recommended hooks -- Set up git hooks for the project

Wait for user to pick an action. Do not proceed automatically.

If the user picks option 1, call mags_generate_claude_md and write the result to the project root. If the user picks option 2, ask for the module name, then call mags_scaffold_module (pass the locale from config.yaml if available). If the user picks option 3, create the appropriate hook scripts in .githooks/ or configure via the project's tooling (husky for Node, pre-commit for Python, etc.).


Related commands:

CommandDescription
/mags-initInitialize MAGS for a new project
/mags-legacyInitialize MAGS for a legacy project
/mags-helpSee all available commands

Source

git clone https://github.com/doancan/mags/blob/main/skills/mags-setup/SKILL.mdView on GitHub

Overview

mags-setup analyzes the current project to identify its stack, tooling, and workflow needs, then outputs an optimal Claude Code setup. It reads locale from .mags/config.yaml, gathers a project-wide signal set, detects language, framework, and CI/tooling, and then tailors a practical plan for slash commands, hooks, and CLAUDE.md audits.

How This Skill Works

It gathers signals in parallel: reads locale from .mags/config.yaml, fetches mags_project_summary for context, uses Glob to detect project type and frameworks, and inspects manifests like package.json. Based on detected stack, it proposes a SKILLS checklist, HOOKS, and MCP SERVERS, and then runs mags_audit_claude_md to evaluate or validate CLAUDE.md.

When to Use It

  • Initializing Claude Code workflows for a brand-new repo
  • Overhauling an existing project to align with the detected stack
  • Setting up automated CLAUDE.md audits and generation
  • Configuring pre-commit or pre-push hooks for linting, tests, or formatting
  • Tuning locale-based behavior using .mags/config.yaml

Quick Start

  1. Step 1: Run the mags-setup analysis to gather project signals (locale, stack, dependencies)
  2. Step 2: Review the recommended SKILLS, HOOKS, and MCP SERVERS; run CLAUDE.md audit check
  3. Step 3: Choose an action such as Generate/Update CLAUDE.md or Scaffold a module, then implement

Best Practices

  • Verify .mags/config.yaml locale is accurate and used consistently
  • Cross-check detected stack against the actual manifests (package.json, Cargo.toml, etc.)
  • Run mags_audit_claude_md after major changes to CLAUDE.md
  • Test the recommended hooks in a dedicated branch or environment
  • Document the chosen setup in the repo so future contributors understand the workflow

Example Use Cases

  • Node/JS project with Next.js detected; mags-setup recommends /commit, pre-commit hooks, and GitHub Actions workflow
  • Python project using pyproject.toml and Docker; setup suggests /commit, /test, and CLAUDE.md audit
  • Rust project with Cargo.toml and Prisma; setup includes code-scanning hooks and module scaffolding
  • Go microservice using docker-compose and GitHub Actions; setup highlights container tests and deploy steps
  • Java project with pom.xml and TailwindCSS; setup proposes UI scaffolding and CI tests

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers