# Attach Project

> Use when adding Claude Code structure to an existing project. Auto-detects stack, creates only missing files.

- **Type:** Skill
- **Install:** `agentstack add skill-vladislavsournine-vladyslav-skills-attach-project`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [VladislavSournine](https://agentstack.voostack.com/s/vladislavsournine)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [VladislavSournine](https://github.com/VladislavSournine)
- **Source:** https://github.com/VladislavSournine/vladyslav-skills/tree/main/skills/attach-project

## Install

```sh
agentstack add skill-vladislavsournine-vladyslav-skills-attach-project
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Attach Project

**Type:** Engineer (light)

## Overview

Add Claude Code structure to an **existing** project. Never overwrites existing files. Auto-detects stacks via `scripts/detect-stack.sh`. The bash scaffolder (`scripts/attach-project.sh`) does all the work in ~0.5 seconds.

This was a Heavy Engineer skill until v3.1.0. Like `init-project` v3.0.0, the dispatched Sonnet subagent was doing pure mechanics (`mkdir`, `cp`, `sed`) — no LLM thinking needed for any of it.

## Process

### Step 0: Pre-flight (Opus main)

Collect inputs that the scaffolder can't auto-detect.

1. **Verify project root.** Run `ls -A`. The scaffolder will reject the run if no project markers exist, so this is a pre-emptive sanity check. If pwd looks empty (no `.git/`, no language manifest like `package.json` / `requirements.txt` / etc.) → STOP and suggest `/vladyslav:init-project` for a new project.

2. **Run stack detection** for the user's information:

   ```bash
   /scripts/detect-stack.sh .
   ```

   Parse the JSON to show the user what was detected. Example: "Detected: python, docker". This is informational — the scaffolder runs detection again internally.

3. **AskUserQuestion — additional stacks not auto-detected** (multi-select):
   > "Detected stacks: ``. Want to add any stacks not detected?"
   > Options: `python`, `go`, `flutter`, `swift`, `kotlin`, `other`, `none`.

4. **For each "other" stack** — AskUserQuestion three times:
   - `label` (e.g. "Rust backend")
   - `dir` (e.g. `rust`)
   - `gitignore` entries (comma-separated, e.g. `target/,Cargo.lock`)

5. **AskUserQuestion — domain** (free text, optional):
   > "Project domain / purpose? (e.g. 'iOS fitness app', 'Python data pipeline') — type `none` to skip"

6. **AskUserQuestion — private mode** (single-select):
   > "Private mode? Gitignore AI workflow files (CLAUDE.md, .claude/, docs/plans/)?"
   > Options: `yes`, `no`.

7. **Resolve plugin root.** Same approach as `init-project`: Glob `~/.claude/plugins/cache/vladyslav-marketplace/vladyslav/*/scripts/attach-project.sh` and take the directory two levels up. Fall back to `/Volumes/DevSSD/Development/vladyslav-skills` (dev clone).

### Step 1: Run the scaffolder

Execute (via the Bash tool):

```bash
/scripts/attach-project.sh \
    --pwd  \
    --plugin-root  \
    [--additional-stacks "python,go,..."] \
    [--other-stacks "label1:dir1:gitignore-entries1;label2:dir2:gitignore-entries2"] \
    --domain "" \
    --private-mode 
```

**`--other-stacks` format**: semicolon-separated list of `label:dir:gitignore` triples. The `gitignore` part is itself a comma-separated list. Pass empty string `""` if no "other" stacks were chosen.

The script emits JSON:

```json
{
  "status": "success" | "error",
  "detected_stacks": [],
  "files_written": [],
  "files_skipped": [],
  "warnings": [],
  "error": ""
}
```

Capture this output.

### Step 2: Present summary

Parse the JSON. Render to the user:

**`status: success`**:

```
✓ attach-project complete
  Detected: 
  Files written:  — 
  Files preserved (already existed):  — 
  Warnings: 
  Next: /vladyslav:ingest  — scan codebase, populate docs/, and seed MemPalace
```

**`status: error`**:

```
✗ attach-project failed
  Error: 
```

---

## What the scaffolder does (auditing reference)

The bash scaffolder, given the parameters above, writes ONLY these paths if they do not already exist:

- `CLAUDE.md` — with auto-generated Stack section based on detected + additional stacks
- `.gitignore` — APPENDED with stack-specific entries (Python / Go / Flutter / Swift / Kotlin / Node / Web), editors/OS, secrets/env, logs, and (if private mode) AI workflow file lines. Existing entries are preserved verbatim, duplicates are skipped via `grep -Fxq`.
- `.claude/settings.json` — with `PROJECT_DOCS_ROOT` env
- `.claude/agents/docs-agent.md` — documentation maintainer
- `.claude/agents/code-review-agent.md` — code-review agent
- `docs/architecture/system.md`, `docs/product/prd.md`, `docs/plans/tasks.md` — stub files (`# Title\n\n*to be filled*\n`)
- Per detected/added stack: a placeholder directory (`python/`, `go/`, `swift/`, `flutter/`, `kotlin/`) with `.gitkeep` — but ONLY if no matching directory (or sibling like `backend/`, `app/`, `ios/`, `android/`) already exists.
- Per "other" stack: the user-specified `/` with `.gitkeep`.

**Idempotent:** rerun is safe. Every pre-existing file is reported in `files_skipped`. No file is ever overwritten.

**No git init:** the project already has version control. The scaffolder doesn't touch git.

**No backend scaffolding:** unlike `init-project`, this skill does NOT create `requirements.txt`, FastAPI `main.py`, Dockerfile, docker-compose files, etc. Those would conflict with the existing project. attach-project adds only the AI workflow shell.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [VladislavSournine](https://github.com/VladislavSournine)
- **Source:** [VladislavSournine/vladyslav-skills](https://github.com/VladislavSournine/vladyslav-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-vladislavsournine-vladyslav-skills-attach-project
- Seller: https://agentstack.voostack.com/s/vladislavsournine
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
