Skip to content
Back to skills

Opt In Workspace Writes

ASecurity

Extensions/tools that auto-write to user workspaces without consent:

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 3, 2026
ai-agentstypescriptgitci/cd

Works with

  • vscode
  • cli

Security analysis

A93/100
  • highPerforms destructive filesystem operations

Pro shows the line behind each finding and how to fix it

Scanned September 3, 2026

npx -y skills add fabioc-aloha/Alex_Skill_Mall --skill opt-in-workspace-writes --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Opt In Workspace Writes?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Opt In Workspace Writes
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fabioc-aloha-opt-in-workspace-writes/badge)](https://www.skillsdirectory.com/skills/fabioc-aloha-opt-in-workspace-writes)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: opt-in-workspace-writes
description: "Extensions/tools that auto-write to user workspaces without consent:"
lastReviewed: 2026-04-30
---

# Opt-In for Workspace Writes

## The Problem

Extensions/tools that auto-write to user workspaces without consent:

- Create `.vscode/` folders unexpectedly
- Add config files that get committed accidentally
- Scaffold structures the user didn't want
- Violate the principle of least surprise

## The Solution

Get explicit consent before any workspace mutation.

### 1. Ask First

```typescript
const choice = await vscode.window.showInformationMessage(
  'Initialize Alex configuration in this workspace?',
  { modal: true },
  'Yes, create .github/',
  'No, skip'
);

if (choice !== 'Yes, create .github/') {
  return; // User declined, do nothing
}
```

### 2. Show What Will Be Created

```typescript
const files = [
  '.github/copilot-instructions.md',
  '.github/config/settings.json'
];

const choice = await vscode.window.showInformationMessage(
  `This will create ${files.length} files:\n${files.join('\n')}`,
  { modal: true, detail: files.join('\n') },
  'Create Files',
  'Cancel'
);
```

### 3. Provide Undo/Remove

```typescript
// After creating files
vscode.window.showInformationMessage(
  'Configuration created.',
  'Undo'
).then(selection => {
  if (selection === 'Undo') {
    // Delete the created files
    files.forEach(f => fs.unlinkSync(path.join(workspaceRoot, f)));
  }
});
```

## Never Auto-Write These

| Path | Why It's Dangerous |
|------|-------------------|
| `.vscode/` | Shared via git, affects all developers |
| `.github/` | Shared via git, affects CI/CD |
| `package.json` | Changes dependencies/scripts |
| `.gitignore` | Affects what's tracked |
| Root config files | `.eslintrc`, `tsconfig.json`, etc. |

## Acceptable Auto-Behavior

- Reading files (no consent needed)
- Writing to temp directories
- Writing to user-global config (already your data)
- Writing to extension storage area

## Verification

1. Fresh install → no files created until user opts in
2. User can decline and extension still works
3. Created files are clearly attributed to the extension

## When to Apply

- Extension activation
- Command that generates files
- Any feature that modifies workspace

## Tags

`architecture` `extension-development` `ux` `consent`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.