ModCodePatternIntelligent code consistency β zero oversight, any language, any framework.
One JSON file. Infinite automation.
Why ModCodePattern?
Works with every language β JavaScript, TypeScript, Python, Java, Rust, Go, C#, PHP, Ruby, and more. Get Started in 30 Seconds1. Install ModCodePattern from the VS Code Marketplace 2. Create a
3. Create a new component file β a Todo task appears instantly!
Features at a Glance
File System Monitoring
Four notification typesFile β Remind to update a specific file:
Folder β Remind to work in a directory:
Commands β Remind to run scripts:
URL (External Links) β Open a link in the browser:
Use
Pattern Identification
The
Pattern IDs appear in the Health Check output, workspace statistics, and the Todo list β making it easy to trace which rule generated which task. Content Filtering
Instead of reacting to every save on a file, use
This prevents noise β you only get reminders when it actually matters. Inline Hints
When a pattern triggers, ModCodePattern can display inline hints as decorations right in the affected files β no need to open the Todo list to know what to do:
Configure per patternUse
Best for: synchronization reminders, guidance for new developers, contextual notes. Disable for: high-frequency patterns that would clutter the editor.
|
| Chained Patterns | Linked Tasks (triggerNext) |
|
|---|---|---|
| Mechanism | Implicit (glob matching) | Explicit (by pattern id) |
| Advances when... | You create/modify a file that matches the next trigger | You check off all tasks in the Todo list |
Requires id |
No | Yes |
| Best for | File-creation pipelines | Multi-step checklists, onboarding, reviews |
| Complexity | Simple, natural | More control, more guided |
You can combine both approaches in the same project for maximum flexibility.
Adaptive Variables β Auto-detects Your Architecture
No hard-coded paths. Your patterns work across any project structure.
{
"onCreateFile": "{{COMPONENTS_DIR}}/**/*.tsx",
"notify": ["{{COMPONENTS_DIR}}/index.ts"],
"description": "📦 Export {{TRIGGER_NAME}} component"
}
Whether your components live in src/components/, app/ui/, or lib/widgets/ β the pattern just works.
Architecture variables (auto-detected)
| Variable | Resolves to... | Examples |
|---|---|---|
{{SRC_DIR}} |
Main source directory | src, lib, app |
{{COMPONENTS_DIR}} |
Components directory | src/components, app/ui |
{{HOOKS_DIR}} |
Hooks / composables | src/hooks, src/composables |
{{API_DIR}} |
API / services | src/api, src/services |
{{TESTS_DIR}} |
Tests directory | tests, __tests__, spec |
{{DOCS_DIR}} |
Documentation | docs, documentation |
{{CONFIG_DIR}} |
Config directory | config, configs |
{{CONFIG_FILE}} |
Config file | config/index.ts |
{{TYPES_FILE}} |
Types file | src/types/index.ts |
Variable status: Run Ctrl+Shift+P β "ModCodePattern: Show Adaptive Variables" to see which variables are β
Found (directory exists in your project) vs β Not Assigned (suggested but not yet created). Only found variables resolve in your patterns β create the missing directories to activate them automatically.
Runtime variables
| Variable | Description | Example |
|---|---|---|
{{TRIGGER_PATH}} |
Full path of the triggering file | src/components/Button.tsx |
{{TRIGGER_FILE}} |
File name with extension | Button.tsx |
{{TRIGGER_NAME}} |
File name without extension | Button |
{{TRIGGER_DIR}} |
Directory of the triggering file | src/components |
{{TRIGGER_TYPE}} |
Event type that fired | onCreateFile |
Tip: Use
{{TRIGGER_NAME}}(not{{TRIGGER_FILE}}) when building file paths to avoid double extensions likeButton.tsx.test.tsx.
Custom variables
Define your own reusable values:
{
"variables": {
"COMPANY": "Acme",
"API_VERSION": "v2",
"DESIGN_SYSTEM": "lib/design"
},
"patterns": [
{
"onChange": "{{DESIGN_SYSTEM}}/**/*.tsx",
"notify": [
{ "file": "docs/{{COMPANY}}/api-{{API_VERSION}}.md", "description": "📝 Update docs" }
]
}
]
}
Custom variables can override auto-detected ones if your project uses a non-standard structure:
{
"variables": {
"COMPONENTS_DIR": "lib/ui",
"TESTS_DIR": "spec"
}
}
Variable Transformations 🔒 Premium
Transform any variable on the fly with pipe filters β 17 built-in transformations.
Apply transformations directly inside {{ }} using the pipe | syntax:
{
"onCreateFile": "{{COMPONENTS_DIR}}/**/*.tsx",
"notify": [
{
"file": "tests/{{TRIGGER_NAME | kebabCase}}.test.tsx",
"description": "🧪 Test for {{TRIGGER_NAME | pascalCase}}"
}
]
}
If you create MyButton.tsx:
{{TRIGGER_NAME | kebabCase}}βmy-button{{TRIGGER_NAME | pascalCase}}βMyButton
All 17 transformations
| Transform | Description | Example |
|---|---|---|
uppercase |
ALL CAPS | MyButton β MYBUTTON |
lowercase |
all lowercase | MyButton β mybutton |
capitalize |
First letter capitalized | hello β Hello |
camelCase |
camelCase | my-button β myButton |
pascalCase |
PascalCase | my-button β MyButton |
kebabCase |
kebab-case | MyButton β my-button |
snakeCase |
snake_case | MyButton β my_button |
constantCase |
CONSTANT_CASE | MyButton β MY_BUTTON |
slugify |
URL-safe slug | Mon Composant β mon-composant |
reverse |
Reverse string | Button β nottuB |
basename |
File name from path | /src/components/Button.tsx β Button.tsx |
dirname |
Parent directory | /src/components/Button.tsx β /src/components |
ext |
File extension | Button.tsx β .tsx |
length |
Character count | Button β 6 |
first:n |
First n characters | {{NAME \| first:3}} β But |
last:n |
Last n characters | {{NAME \| last:3}} β ton |
replace:old:new |
Replace text | {{NAME \| replace:-:_}} β my_button |
Chain multiple transformations
{
"file": "logs/{{TRIGGER_NAME | lowercase | replace:_:-}}.log",
"description": "📊 Log for {{TRIGGER_NAME | uppercase | first:10}}"
}
Scheduled Reminders
Never miss a standup, a deadline, or an end-of-day commit again.
{
"onSchedule": {
"time": "09:00",
"days": ["monday", "tuesday", "wednesday", "thursday", "friday"]
},
"notify": [
{
"url": "https://meet.google.com/your-standup",
"description": "🕘 Daily standup β {{DAY_NAME_FR}} {{DATE_FORMATTED}}"
}
]
}
{
"onSchedule": {
"time": "17:00",
"days": "daily"
},
"notify": [
{
"commands": ["git status"],
"description": "🕐 End-of-day commit check β {{WORKSPACE_NAME}}"
}
]
}
Schedule options
| Property | Type | Description | Example |
|---|---|---|---|
time |
string | Time in HH:MM (required) | "14:30" |
days |
string/array | Repeat days | "daily", ["monday", "friday"] |
date |
string | One-time date (YYYY-MM-DD) | "2025-12-31" |
timezone |
string | Timezone | "Europe/Paris" |
repeat |
boolean | Repeat (default: true) | false |
Temporal variables
| Variable | Description | Example |
|---|---|---|
{{SCHEDULED_TIME}} |
Planned trigger time | "14:30" |
{{ACTUAL_TIME}} |
Real trigger time | "14:31" |
{{CURRENT_DATE}} |
Today's date | "2025-01-15" |
{{DAY_OF_WEEK}} |
Day in English | "monday" |
{{DAY_NAME_FR}} |
Day in French | "lundi" |
{{DATE_FORMATTED}} |
Formatted date (French) | "15 janvier 2025" |
{{TIME_12H}} |
12-hour format | "2:30 PM" |
{{TIMESTAMP}} |
Unix timestamp | "1702651800000" |
{{TIMEZONE}} |
Timezone | "Europe/Paris" |
{{WORKSPACE_NAME}} |
Current workspace name | "my-project" |
{{ACTIVE_FILE}} |
Currently open file path | "/path/to/file.ts" |
{{ACTIVE_FILE_NAME}} |
Currently open file name | "file.ts" |
{{PATTERN_ID}} |
Pattern identifier | "daily-standup" |
{{IS_REPEATING}} |
Whether recurring | "true" |
{{TIME_DRIFT}} |
Drift in seconds | "45" |
Free: 3 scheduled reminders | Premium: Unlimited
Manual Commands
Create custom "magic buttons" in the Command Palette for your most complex workflows.
Open Ctrl+Shift+P β "ModCodePattern: Run Pattern" and pick any command you defined:
{
"onManual": "deployProduction",
"manualTitle": "🚀 Deploy to Production",
"description": "Full deployment checklist",
"notify": [
{ "commands": ["npm run build", "npm test"], "description": "🔧 Build & test" },
{ "file": "CHANGELOG.md", "description": "📋 Update changelog" },
{ "url": "https://dashboard.production.com", "description": "🌐 Open monitoring" }
]
}
More ideas:
| Command | Use case |
|---|---|
🛠οΈ Project Setup |
Install deps, configure env, init hooks |
📋 Quality Checklist |
Lint, test, build before merge |
🔧 Weekly Maintenance |
npm audit, clean branches, update deps |
👋 New Developer Onboarding |
Read docs, configure tools, join channels |
🧪 Full Test Suite |
Unit, integration, e2e tests + coverage report |
Free: 3 manual commands | Premium: Unlimited
Multilingual Descriptions
Write pattern descriptions in both English and French β ModCodePattern picks the right one based on VS Code language.
{
"onChange": "src/api/**/*.ts",
"notify": [
{
"file": "src/types/api.ts",
"description": {
"fr": "📘 Mettre Γ jour les types API",
"en": "📘 Update API types"
}
}
],
"description": {
"fr": "🔧 API modifiΓ©e",
"en": "🔧 API modified"
}
}
Your descriptions, notifications, and Todo items will appear in the user's language automatically.
Modular Configuration
Split your patterns across multiple files for large projects. Premium
{
"imports": [
".mod-patterns/react.json",
".mod-patterns/api.json",
".mod-patterns/testing.json"
],
"patterns": [
{
"onChange": "package.json",
"notify": ["README.md"],
"description": "📦 Dependencies changed"
}
]
}
Each imported file contains its own "patterns" array. Keep your config clean and organized by domain:
.mod-patterns/
βββ react.json β Component patterns
βββ api.json β API & service patterns
βββ testing.json β Test automation patterns
βββ onboarding.json β Developer onboarding
Git Event Automation 🔒 Premium
React to Git events in real time β branch switches, commits, pushes, and more.
Available Git triggers
| Trigger | Fires when... |
|---|---|
onBranchSwitch |
You switch branches |
onCommit |
A new commit is created |
onBranchCreate |
A new branch is created |
onBranchDelete |
A branch is deleted |
onPull |
You pull from remote |
onPush |
You push to remote |
Examples
Auto-deploy when switching to main:
{
"onBranchSwitch": { "to": "main" },
"notify": [
{
"commands": ["npm run build:production", "npm run deploy"],
"description": "🚀 Deploy {{PROJECT_NAME}} to production"
}
]
}
Update changelog on feature commits:
{
"onCommit": { "message": "feat:*" },
"notify": [
{ "file": "CHANGELOG.md", "description": "📝 Document: {{COMMIT_MESSAGE}}" }
]
}
Setup environment on new feature branches:
{
"onBranchCreate": { "name": "feature/*" },
"notify": [
{ "file": "docs/features/{{BRANCH_NAME}}.md", "description": "📝 Create feature doc" },
{ "commands": ["npm install"], "description": "📦 Install dependencies" }
]
}
Auto-install after pull:
{
"onPull": { "remote": "origin", "branch": "main" },
"notify": [
{ "commands": ["npm install"], "description": "📦 Install new dependencies" }
]
}
Git variables (13+)
| Variable | Description | Example |
|---|---|---|
{{BRANCH_NAME}} |
Current branch | feature/user-auth |
{{BRANCH_TYPE}} |
Detected type | feature, hotfix, main |
{{BRANCH_PREFIX}} |
Branch prefix | feature, release |
{{BRANCH_SUFFIX}} |
Branch suffix | user-auth, 123 |
{{BRANCH_PREVIOUS}} |
Previous branch | develop |
{{COMMIT_MESSAGE}} |
Commit message | feat: add login |
{{COMMIT_AUTHOR}} |
Commit author | Jane Doe |
{{REPOSITORY_NAME}} |
Repository name | my-app |
{{REPOSITORY_PATH}} |
Repository absolute path | /Users/dev/projects/app |
{{PROJECT_NAME}} |
Project name | @company/frontend |
{{REMOTE_NAME}} |
Remote name | origin |
{{BRANCH_CREATED}} |
Newly created branch | feature/new-feature |
{{BRANCH_DELETED}} |
Deleted branch | hotfix/bug-123 |
Built-in Smart Features
JSON Auto-completion & Validation
The built-in JSON Schema gives you real-time suggestions and error checking as you type in .mod-patterns.json. Press Ctrl+Space to explore all options β triggers, notification types, variables, and properties are all documented inline.
Interactive Todo List
All pattern notifications appear as checkable tasks in a dedicated VS Code panel. Open it anytime with Ctrl+Shift+P β "ModCodePattern: Open Todo List". Tasks include clickable file links, executable commands, and openable URLs.
Health Check
Run Ctrl+Shift+P β "ModCodePattern: Run Health Check" to detect:
- Overly broad patterns (
**/*.*) - Non-existent directories referenced in patterns
- Undefined or empty variables (adaptive, custom, runtime β each verified intelligently)
- Results shown in a dedicated Output Channel
Pattern Toggle
Pause all patterns instantly with Ctrl+Shift+Alt+P (status bar shows "βΈοΈ Paused"), or disable individual patterns with enabled:
{
"id": "heavy-pattern",
"onChange": "src/**/*.ts",
"enabled": false,
"notify": [{ "file": "src/index.ts", "description": "📦 Update exports" }],
"description": "Temporarily disabled"
}
- Global toggle does not affect manual commands
enabled: falsehides the pattern from manual command selection too
Silent Mode
Keep detections running in the background without popup notifications:
Settings β ModCodePattern β Silent Mode: true
The Todo list and status bar still work β you just won't be interrupted by popups.
Workspace Statistics
Run Ctrl+Shift+P β "ModCodePattern: Show Workspace Statistics" to see active patterns count, usage limits, workspace info, and variable status at a glance.
Smart Notification System
- 1st detection of a task β popup notification shown
- Repeated saves (Ctrl+S spam) β notifications silenced
- After task completion β popup re-enabled if triggered again
- The Todo list is the single source of truth β no duplicate popups
Real-World Examples
React project
{
"patterns": [
{
"id": "react-component",
"onCreateFile": "{{COMPONENTS_DIR}}/**/*.tsx",
"notify": [
{ "file": "{{COMPONENTS_DIR}}/index.ts", "description": "📦 Export {{TRIGGER_NAME}}" },
{ "file": "src/stories/{{TRIGGER_NAME}}.stories.tsx", "description": "📖 Create Storybook story" },
{ "folder": "{{TESTS_DIR}}/components/", "description": "🧪 Add unit tests" }
],
"showInlineHint": true,
"description": "New React component"
}
]
}
API + Documentation
{
"id": "api-sync",
"onChange": "src/api/**/*.ts",
"contentFilter": "export",
"notify": [
{ "file": "src/types/api.d.ts", "description": "📝 Update API types" },
{ "file": "docs/api/{{TRIGGER_NAME}}.md", "description": "📖 Update API docs" },
{ "file": "tests/api/{{TRIGGER_NAME}}.test.ts", "description": "🧪 Update tests" }
],
"description": "🔧 API endpoint modified"
}
Full onboarding workflow (Linked Tasks)
{
"patterns": [
{
"id": "onboarding-step-1",
"onStart": true,
"notify": [
{ "file": "README.md", "description": "📚 Read the project guide" },
{ "file": "docs/ARCHITECTURE.md", "description": "🏗οΈ Understand the architecture" }
],
"triggerNext": "onboarding-step-2",
"description": "👋 Step 1 β Read the docs"
},
{
"id": "onboarding-step-2",
"onStart": true,
"notify": [
{ "commands": ["npm install"], "description": "📦 Install dependencies" },
{ "commands": ["npm run dev"], "description": "🚀 Start dev server" }
],
"triggerNext": "onboarding-step-3",
"description": "βοΈ Step 2 β Setup environment"
},
{
"id": "onboarding-step-3",
"onStart": true,
"notify": [
{ "url": "https://company.slack.com/channels/dev-team", "description": "💬 Join the team channel" },
{ "file": "docs/CODING_STANDARDS.md", "description": "📏 Review coding standards" }
],
"description": "🤝 Step 3 β Join the team"
}
]
}
Multi-language project
{
"onChange": "src/**/*.{py,java,rs,go}",
"notify": [
{ "file": "tests/test_{{TRIGGER_NAME}}.{py,java,rs,go}", "description": "🧪 Update tests" }
],
"description": "🔧 Source file modified"
}
Combined workflow (Chained + Git + Schedule + Manual)
{
"patterns": [
{
"onBranchCreate": { "name": "feature/*" },
"notify": [
{ "file": "docs/features/{{BRANCH_SUFFIX}}.md", "description": "📝 Document feature" }
],
"description": "🌱 New feature branch"
},
{
"onSchedule": { "time": "09:00", "days": ["monday", "wednesday", "friday"] },
"notify": [
{ "url": "https://meet.google.com/standup", "description": "🕘 Standup β {{DAY_NAME_FR}}" }
]
},
{
"onManual": "release",
"manualTitle": "🚀 Release Checklist",
"notify": [
{ "commands": ["npm test", "npm run build"], "description": "β
Validate" },
{ "file": "CHANGELOG.md", "description": "📋 Update changelog" },
{ "commands": ["npm version patch"], "description": "🔖 Bump version" }
]
}
]
}
Ready-to-Use Pattern Library
Skip the setup β grab pre-built, tested patterns for your stack:
React Β· Vue.js Β· Angular Β· Node.js Β· TypeScript Β· Python Β· and more
Browse the Pattern Library β
Free vs Premium
Free β Perfect to get started
- 5 file-monitoring patterns
- 3 scheduled reminders
- 3 manual commands
- Full adaptive, runtime & custom variables
- 4 notification types (file, folder, command, URL)
- Chained patterns & linked tasks (
triggerNext) - Inline hints, content filtering, pattern identification
- Interactive Todo list, JSON schema, multilingual support
onStarttrigger, pattern toggle, silent mode- Health check & workspace statistics
Premium β $6/month Β· For teams and power users
Everything in Free, plus:
- Unlimited patterns, reminders, and manual commands
- 17 variable transformations β
{{NAME | camelCase}},{{PATH | basename}},{{NAME | replace:old:new}} - Git event automation β branch, commit, pull, push triggers
- 13+ Git dynamic variables β
{{BRANCH_NAME}},{{COMMIT_MESSAGE}}, etc. - Modular configuration β split patterns across files with
imports - Priority support
- 14-day free trial
All Commands
| Command | Shortcut | Description |
|---|---|---|
ModCodePattern: Open Todo List |
β | View your pattern-generated tasks |
ModCodePattern: Run Pattern |
β | Execute a manual command |
ModCodePattern: Show Adaptive Variables |
β | See detected project variables & status |
ModCodePattern: Toggle All Patterns |
Ctrl+Shift+Alt+P |
Pause / resume all patterns |
ModCodePattern: Toggle Notifications |
β | Mute / unmute popup notifications |
ModCodePattern: Run Health Check |
β | Diagnose pattern issues & variables |
ModCodePattern: Show Workspace Statistics |
β | View usage and limits |
ModCodePattern: Show License Status |
β | Check your current plan |
ModCodePattern: Upgrade to Premium |
β | Open the upgrade page |
ModCodePattern: Refresh Cache |
β | Reload variables and cache |
ModCodePattern: Start |
β | Trigger onStart patterns manually |
Resources
- Complete Documentation β Full interactive guide with all features
- Pattern Library β Ready-to-use patterns by technology
- Pattern Builder β Visual pattern generator
- French Documentation β Guide utilisateur complet en franΓ§ais
Current version: v0.4.0 | Engine: VS Code 1.74.0+ | Startup: < 200ms | License: MIT
Made with precision for developers who care about consistency.


