# dce-dev-wizard

Wizard for managing development apps at Harvard DCE.

## Quick Start

Install the [AWS Session Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/install-plugin-macos-overview.html).

Install the wizard into your project:

`npm i --save-dev dce-dev-wizard`

Add a `dceConfig.json` file to the root folder of your project that contains all existing deployments (caccl-deploy services):

```json
{
  "dbName": "immersive-player-store",
  "deployments": [
    {
      "name": "Stage",
      "app": "courseadmintools-stage",
      "profile": "stage"
    },
    {
      "name": "Prod",
      "app": "courseadmintools",
      "profile": "prod"
    }
  ],
  "relatedClusters": [
    {
      "name": "Opencast Dev 10",
      "cluster": "opencast-ecs-immersive"
    }
  ]
}
```

Where "deployments" is an array of existing caccl-deploy services. "name" is a human-readable name/description of the deployment, "app" is the caccl-deploy app name, and "profile" is the aws profile associated with accessing that service.

In your `package.json`, add to the end of your top-level build script:

`"build": "[...] && npm explore dce-dev-wizard -- npm run build-error-docs"`

Whenever you build, we will then update your error docs in the `/docs` folder.

##### A note about connecting to the database

Database connections are tunneled through an ephemeral, on-demand bastion instance. The instance self-terminates 60 minutes after it is launched, interrupting any ongoing operations. To use a different lifetime, set `DB_CONNECT_BASTION_TTL_MINUTES` to a whole number of minutes between 1 and 1440 (24 hours); an unusable value is reported and ignored in favor of the default. The tunnel persists across menu screens and is cleaned up when the wizard exits.

To make use of the database connection feature, the IAM user groups for caccl-deploy developers have the `TempBastionUserAccess` managed policy attached in each AWS account.

## AvoSecurity (Claude skill)

The wizard ships **AvoSecurity**, our monthly security-update process as a Claude skill:
audit every lockfile, research findings, upgrade without downgrading/swapping/overriding,
queue fixes for in-house libs, write Ky tests, hand off for deploy, verify on the instance,
log `docs/SecurityUpdates.md`, bump the patch version.

Add it to your Claude once: run `npm run dev:wizard`, choose **AvoSecurity**, and either
package it (upload the zip at Customize > Skills in Claude; skills enabled there also sync to
Claude Code) or install it straight into `~/.claude/skills` for Claude Code. Then, with the
project folder available to Claude, say "Run AvoSecurity on this project" (add the Wiz CSV
path when you have one). The scripts Claude runs live in
`node_modules/dce-dev-wizard/avo-security/scripts/`, so they match the wizard version each
project has installed. Re-package after updating the wizard.

Policy baked into the skill: never downgrade, never swap or add a dependency without a
developer's yes, never replace an in-house package (fix the lib, publish, then bump), no
`overrides`, no `--force`/`--legacy-peer-deps`, `npm ci` on the project's Node version first.
Accepted risks go to `.reviewed-cves` (the same format the Vulnerability Checker writes) and
to `docs/SecurityUpdates.md`.
