## 1. Project Detection

- [x] 1.1 Add `detect_project_type(directory: Path) -> str` function that returns `"cdk"`, `"terraform"`, `"ambiguous"`, or `"none"` based on file presence
- [x] 1.2 Add `--mode` option to `lws dev` command (choices: `cdk`, `terraform`)
- [x] 1.3 Integrate project detection into `_run_dev()` — branch on mode before CDK-specific parsing
- [x] 1.4 Add tests for project detection (tf only, cdk only, both, neither)

## 2. Terraform Override File

- [x] 2.1 Create `src/lws/terraform/override.py` with `generate_override(port: int, project_dir: Path) -> Path` and `cleanup_override(project_dir: Path) -> None`
- [x] 2.2 Override file template with marker comment, dummy credentials, skip flags, endpoint map, and `s3_use_path_style`
- [x] 2.3 Marker comment detection — refuse to overwrite files not generated by LWS
- [x] 2.4 Stale override cleanup on startup
- [x] 2.5 Override file deletion on graceful shutdown (in finally block)
- [x] 2.6 Add tests for override generation, cleanup, marker detection, and port mapping

## 3. Gitignore Management

- [x] 3.1 Add `ensure_gitignore(project_dir: Path, entry: str) -> None` function
- [x] 3.2 Handle: append to existing `.gitignore`, create new `.gitignore`, skip if already present
- [x] 3.3 Add tests for all three gitignore scenarios

## 4. Terraform Dev Mode

- [x] 4.1 Add `_run_dev_terraform(port: int, config: LdkConfig) -> None` function in `ldk.py`
- [x] 4.2 Start all providers in always-on mode (no AppModel parsing)
- [x] 4.3 Generate override file after providers start
- [x] 4.4 Display startup summary with service endpoints and `terraform apply` instructions
- [x] 4.5 Register graceful shutdown to clean up override file
- [x] 4.6 Add integration test: start Terraform mode, verify override file created, verify endpoints respond

## 5. Stub Operations for Terraform Compatibility

- [x] 5.1 Add catch-all handler to DynamoDB routes for unknown operations (return error with warning log)
- [x] 5.2 Add catch-all handler to SQS routes for unknown actions
- [x] 5.3 Add catch-all handler to S3 routes for unknown methods/paths
- [x] 5.4 Add catch-all handler to SNS routes for unknown actions
- [x] 5.5 Add catch-all handler to EventBridge routes for unknown targets
- [x] 5.6 Add catch-all handler to Step Functions routes for unknown actions
- [x] 5.7 Add catch-all handler to Cognito routes for unknown targets
- [x] 5.8 Add tests verifying unknown operations return proper errors with warning logged

## 6. Configuration

- [x] 6.1 Add `mode` field to `LdkConfig` dataclass (optional, default `None` for auto-detect)
- [x] 6.2 Load `mode` from `ldk.toml` if present
- [x] 6.3 CLI `--mode` flag overrides config value
- [x] 6.4 Add tests for mode configuration precedence
