# Skill: Prepare a development environment with Basecamp

## Purpose

Use Basecamp when an existing project needs a reproducible development environment across a developer machine, CI job, sandbox, or agent runtime.

Basecamp prepares the environment. Native project tools perform build, test, run, and package operations.

## Default workflow

1. Identify the project stack.
2. If basecamp.lock is missing, run:
   `basecamp init`
3. If basecamp.lock exists, run:
   `basecamp sync`
4. If tracked project inputs changed, run:
   `basecamp update`
5. For an interactive activated environment, run:
   `basecamp shell`
6. Invoke the project's native tool directly.

Rust example:

```bash
basecamp sync
basecamp shell
cargo build
```

Basecamp does not wrap application execution; use the project's native tool after synchronization.

## Rust behavior

Basecamp reads the normal Rust project files.

If Cargo.lock is missing during init/update, Basecamp materializes the selected Rust toolchain and invokes that toolchain's `cargo generate-lockfile`. Cargo.lock is written to the project root.

The CLI computes project-input SHA-256 fingerprints locally; the normal resolver path does not upload Cargo.toml or Cargo.lock contents.

The resolved basecamp.lock records:
- digests of project-native inputs;
- exact host and target;
- exact Rust version;
- a direct upstream Rust toolchain source;
- a Cargo registry package layer tied to the Cargo.lock digest.

Synchronization downloads and verifies the toolchain, lets native Cargo materialize package sources from the project's configured registries or Git dependencies, preserves Cargo's generated vendor source configuration, and writes project-local activation state. Cargo config above the project root is rejected so host-global settings cannot silently enter the environment.

## Inspection and repair

```bash
basecamp status
basecamp doctor
basecamp sync
```

Use update, not sync, when input digests changed.

## Air-gap

```bash
basecamp bundle pack
basecamp bundle unpack project.basecamp
```

A bundle contains basecamp.lock and all already materialized layers.

## Safety

- Do not claim a planned stack is production-ready.
- Do not invent environment requirements without evidence; surface uncertain requirements for confirmation.
- Do not use Basecamp as general-purpose remote command execution.
- Do not replace ecosystem lockfiles with Basecamp-specific dependency declarations.
