# VS Code IDE Rules Template

## Generated by MCP ADR Analysis Server

**Purpose**: Configure VS Code for `{PROJECT_NAME}` with architecture-aware settings and automations.

## Workspace Settings

### Editor Configuration

```json
{
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll": true,
    "source.organizeImports": true
  },
  "editor.rulers": [80, 120],
  "editor.snippetSuggestions": "top",
  "editor.suggestSelection": "first"
}
```

### Language-Specific Settings

```json
{
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "[python]": {
    "editor.defaultFormatter": "ms-python.black-formatter",
    "editor.formatOnSave": true
  }
}
```

## Extensions Configuration

### Required Extensions

```json
{
  "recommendations": [
    "esbenp.prettier-vscode",
    "dbaeumer.vscode-eslint",
    "ms-python.python",
    "ms-vscode.cpptools",
    "golang.go",
    "rust-lang.rust-analyzer"
  ]
}
```

### Extension Settings

```json
{
  "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
  "prettier.requireConfig": true,
  "python.linting.enabled": true,
  "python.linting.pylintEnabled": true
}
```

## Task Automation

### Build Tasks

```json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Build Project",
      "type": "npm",
      "script": "build",
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "problemMatcher": ["$tsc"]
    },
    {
      "label": "Run Tests",
      "type": "npm",
      "script": "test",
      "group": {
        "kind": "test",
        "isDefault": true
      }
    },
    {
      "label": "Architecture Validation",
      "type": "shell",
      "command": "mcp-adr-tool validate-rules",
      "problemMatcher": []
    }
  ]
}
```

### Debug Configuration

```json
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Debug Application",
      "skipFiles": ["<node_internals>/**"],
      "program": "${workspaceFolder}/src/index.js"
    }
  ]
}
```

## Code Snippets

### ADR Generation

```json
{
  "Generate ADR": {
    "prefix": "adr",
    "body": [
      "# ${1:Title}",
      "",
      "## Status",
      "Proposed",
      "",
      "## Context",
      "${2:What is the issue that we're seeing that is motivating this decision?}",
      "",
      "## Decision",
      "${3:What is the change that we're proposing?}",
      "",
      "## Consequences",
      "${4:What becomes easier or harder because of this change?}"
    ],
    "description": "Generate ADR template"
  }
}
```

### Test Template

```json
{
  "Test Case": {
    "prefix": "test",
    "body": [
      "describe('${1:Component}', () => {",
      "  it('should ${2:behavior}', () => {",
      "    // Arrange",
      "    ${3:setup}",
      "    ",
      "    // Act",
      "    ${4:action}",
      "    ",
      "    // Assert",
      "    ${5:expectation}",
      "  });",
      "});"
    ]
  }
}
```

## Keyboard Shortcuts

### Custom Keybindings

```json
[
  {
    "key": "ctrl+shift+a",
    "command": "workbench.action.tasks.runTask",
    "args": "Architecture Validation"
  },
  {
    "key": "ctrl+shift+t",
    "command": "workbench.action.tasks.test"
  },
  {
    "key": "ctrl+shift+d",
    "command": "workbench.action.tasks.runTask",
    "args": "Deployment Check"
  }
]
```

## MCP Integration

### Launch Configuration

```json
{
  "mcp.servers": {
    "adr-analysis": {
      "command": "node",
      "args": ["path/to/mcp-adr-analysis-server"],
      "env": {
        "PROJECT_PATH": "${workspaceFolder}",
        "ADR_DIRECTORY": "./adrs"
      }
    }
  }
}
```

## Project-Specific Rules

### Architecture Validation

```json
{
  "architectureRules": {
    "layerViolations": "error",
    "dependencyDirection": "inward",
    "allowedImports": {
      "domain": [],
      "application": ["domain"],
      "infrastructure": ["domain", "application"]
    }
  }
}
```

### Code Quality Gates

```json
{
  "qualityGates": {
    "coverage": 80,
    "complexity": 10,
    "duplicates": 5,
    "maintainability": "A"
  }
}
```

## Workspace Recommendations

### Folder Structure

```
.vscode/
├── settings.json      # Workspace settings
├── tasks.json        # Task automation
├── launch.json       # Debug configuration
├── extensions.json   # Extension recommendations
└── snippets/         # Custom snippets
    ├── typescript.json
    ├── python.json
    └── general.json
```

## Custom Configuration

Add your VS Code specific customizations:

```json
{
  "custom": {
    // Your project-specific settings
  }
}
```
