# Custom Workflow New Feature

> Start a new feature by asking for a purpose, then creating a branch + worktree + feature doc.

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

## Install

```sh
agentstack add skill-assertchris-claude-skills-custom-workflow-new-feature
```

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

## About

# New Feature

## Step 1: Get purpose

Check `$ARGUMENTS` for a `brief:` key.

- If `brief:` is present in ARGUMENTS: use everything after `brief:` as the raw purpose. **Skip `AskUserQuestion` entirely.**
- If `brief:` is absent: call `AskUserQuestion` **directly and immediately** — do NOT write the question as text first. Ask:

  > "What is this feature for? (keep it short — a few words)"

  Provide 3 example options:
  - `"add user auth"` — describes an authentication feature
  - `"export to CSV"` — describes a data export feature
  - `"fix sidebar layout"` — describes a UI bug fix

  The user will type their own answer via the **Other** field.

Also check `$ARGUMENTS` for a `project:` key. If present, use its value as the project hint. Otherwise the project hint is empty.

If the purpose is empty after sanitisation (step 2), ask again.

## Step 2: Sanitise into a slug

Transform the raw purpose into a slug:

1. Lowercase all characters
2. Replace spaces with hyphens
3. Strip any character that is not `a-z`, `0-9`, or `-`
4. Collapse multiple consecutive hyphens into one
5. Trim leading and trailing hyphens
6. **Truncate to 40 characters max**, cutting at the last `-` boundary (do not cut mid-word)

## Step 3: Determine next branch number

Resolve the project directory for the feature count:

1. If the project hint is non-empty and `/features/` exists: use that as the feature directory.
2. If the project hint is non-empty but that path doesn't exist: derive the basename and search the projects root:
   ```bash
   PROJECTS_DIR=$(dirname $(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD"))
   find "$PROJECTS_DIR" -maxdepth 1 -type d -name "" 2>/dev/null | head -1
   ```
3. If the project hint is empty: use the current directory.

Then run:
```bash
ls /features/ | grep -oE '^[0-9]+' | sort -n | tail -1
```

Increment by 1 and zero-pad to 3 digits (e.g. `77` → `078`). If no output, use `001`.

The branch name is `feature/-`.

## Step 4: Check for feature doc template

Run:
```bash
git -C  show HEAD:features/template.md > /dev/null 2>&1
```

- If it **succeeds**: the template is committed to the repo. No extra copy needed.
- If it **fails**: no committed template exists. Call `AskUserQuestion` **directly and immediately** — do NOT write the question as text first. Ask:

  > "No `features/template.md` found in this project. Which template should I copy into the worktree?"

  Offer these options:
  - `friday.assertchris.dev` — `/home/friday/Code/friday.assertchris.dev/features/template.md`
  - `floaty.dev` — `/home/friday/Code/floaty.dev/features/template.md`
  - `gepetto.assertchris.dev` — `/home/friday/Code/gepetto.assertchris.dev/features/template.md`
  - `shell.assertchris.dev` — `/home/friday/Code/shell.assertchris.dev/features/template.md`

  The user may also type a custom path via **Other**. Remember this path — before creating the feature doc, copy the template file to `{worktree}/features/template.md` (create the features/ directory if needed).

## Step 5: Pull main before creating the worktree

Before creating the worktree, ensure the project's main branch is up to date. Run in the resolved project directory:

```bash
git -C  pull origin $(git -C  rev-parse --abbrev-ref HEAD)
```

If the pull fails (e.g. no remote, offline), warn Chris but continue — do not abort.

## Step 6: Create worktree and feature doc

Create a worktree for the branch in the resolved project using the friday_worktree_create MCP tool. NEVER run git commands manually — the MCP tool handles branch creation inside the worktree so the main project directory always stays on `main`. Do NOT run `git checkout`, `git branch`, or any other git command in the main project directory — it must remain on `main` throughout.

The worktree will be placed at `/.worktrees/`.

Once the worktree exists, copy dependency directories from the main project into the worktree so tools like prettier, tsc, etc. are immediately available without a fresh install. Use `cp -r` (not symlinks) so changes inside the worktree never bleed back. For each of the following directories, if it exists in the main project, copy it into the worktree: `node_modules`, `vendor`.

If a template needed to be copied from another project (step 4), do that now.

Using the worktree's absolute path, create the feature doc file inside the worktree (do not commit it).

## Step 7: Done

Report:

> Worktree ready at: `/.worktrees/`
>
> To work in this worktree from Claude Code CLI, exit this session and run:
> ```
> cd /.worktrees/
> claude
> ```

## Source & license

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

- **Author:** [assertchris](https://github.com/assertchris)
- **Source:** [assertchris/claude-skills](https://github.com/assertchris/claude-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-assertchris-claude-skills-custom-workflow-new-feature
- Seller: https://agentstack.voostack.com/s/assertchris
- 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%.
