init-context
Analyze the codebase and generate context rules for Cursor. Use when setting up or populating .cursor/rules/ files.
Best use case
init-context is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Analyze the codebase and generate context rules for Cursor. Use when setting up or populating .cursor/rules/ files.
Teams using init-context should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/init-context/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How init-context Compares
| Feature / Agent | init-context | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Analyze the codebase and generate context rules for Cursor. Use when setting up or populating .cursor/rules/ files.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Cursor Code Discovery - Automated Workflow You are tasked with analyzing this codebase and completing Cursor rules files. ## Inputs 1. Target directory (optional) - A particular directory within the codebase to focus on. If not provided, analyze the entire codebase. ## Steps 1. Analyze the Codebase (or Directory) - Examine the codebase and gather information. 2. Populate Instruction Files - Use the existing files in `.cursor/rules/`. 3. Update Glob Patterns - If a target directory is provided, adjust the `alwaysApply: true` glob patterns accordingly. 4. Review Created Files - Confirm everything is accurate (make sure everything mentioned actually exists in the codebase). 5. Validate Formatting - Ensure proper formatting is followed based on the Guidelines below. ## Key Analysis Areas 1. **Overview**: Business domain, key concepts, primary user types, integration points, key business workflows 2. **Architecture & Patterns**: Folder structure, module boundaries, layer dependencies, communication patterns, external service integrations 3. **Stack Best Practices**: Language-specific idioms, framework patterns, dependency injection patterns, error handling and validation patterns 4. **Anti-Patterns**: Logging of sensitive data, hardcoded secrets, non-parameterized SQL queries 5. **Data Models**: Core domain entities and relationships, key value objects and DTOs, data validation rules, database migration patterns 6. **Security & Configuration**: Environment variable management, secrets handling (1Password, vaults, etc.), authentication/authorization flow, API security patterns, compliance requirements 7. **Commands & Scripts**: Build scripts, deployment scripts, database migration commands, custom CLI tools ## Guidelines - Each file MUST be **40 lines or fewer** (including frontmatter) - Use bullet points and concise language - Preserve critical technical details - Include specific examples from THIS codebase - Adjust glob patterns as needed if a target directory is provided - Content should be specific to this repository, not generic advice
Related Skills
moai-context7-lang-integration
Enterprise-grade Context7 MCP integration patterns for language-specific documentation access with real-time library resolution and intelligent caching
init-python
Initialize or refresh a root `AGENTS.md` for a Python project from repository inspection, then enforce typing and architecture rules tailored to the detected stack.
init-project
当用户明确要求"初始化项目"、"创建项目指令文件"或"生成 AGENTS.md"时使用。完全自动化:自动检测操作系统默认语言,分析项目目录结构(支持 Python/Web/Rust/Go/Java/数据科学/文档项目等),推断项目类型和用途,一键生成规范的项目指令文档。生成文件包括:AGENTS.md(跨平台通用项目指令,Single Source of Truth)、CLAUDE.md(Claude Code 特定适配,通过 @./AGENTS.md 引用)、README.md(项目介绍与使用方法)、CHANGELOG.md(项目变更记录)。
ddd-context-mapping
Map relationships between bounded contexts and define integration contracts using DDD context mapping patterns.
contextui
Build, run, and publish visual workflows on ContextUI — a local-first desktop platform for AI agents. Create React TSX workflows (dashboards, tools, apps, visualizations), manage local Python backend servers, test workflows via scoped UI automation within the ContextUI app window, and optionally publish to the ContextUI Exchange. All tools operate locally on the user's machine under standard OS permissions — no remote execution or privilege escalation. Python backends bind to localhost. See SECURITY.md for the full capability scope and trust model. Requires ContextUI installed locally and MCP server configured.
contextual-pattern-learning
Advanced contextual pattern recognition with project fingerprinting, semantic similarity analysis, and cross-domain pattern matching for enhanced learning capabilities
context7
Fetch up-to-date library documentation via Context7 REST API. Use when needing current API docs, framework patterns, or code examples for any library. Use when user asks about React, Next.js, Prisma, Express, Vue, Angular, Svelte, or any npm/PyPI package. Use when user says 'how do I use X library', 'what's the API for Y', or needs official documentation. Lightweight alternative to Context7 MCP with no persistent context overhead.
context7-usage
Patterns for using Context7 MCP for library documentation (v2.25)
context7-efficient
Token-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.
context7-docs
Fetch official library docs via Context7 MCP. Use for Tailwind CSS docs (grid, responsive variants), React, Next.js, Vue, MCP, OpenCode, or any npm library. Always use before external web search.
context7-auto-research
Automatically fetch latest library/framework documentation for Claude Code via Context7 API
context-optimization
Apply compaction, masking, and caching strategies