---
id: TASK-8
title: Make clean command remove full build directory
status: Done
assignee: []
created_date: '2026-02-03 17:47'
updated_date: '2026-02-03 18:09'
labels:
  - clean
  - build
  - profiles
dependencies: []
references:
  - lua/zync/api/manager.lua
  - lua/zync/api.lua
  - spec/
  - README.md
  - bin/zync
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Update zync so invoking `zync clean` (or `zync c`) removes the entire root build directory (including all profile subdirectories) rather than only the selected profile build dir, while keeping the `-c/--clean` pre-clean behavior unchanged.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 `zync clean` removes the whole `./build` directory for both profile-less and build-profile projects, including all profile subdirectories.
- [x] #2 `-c/--clean` pre-clean continues to clean only the selected build directory used for the invoked command (current behavior preserved).
- [x] #3 Behavior is covered by new or updated Busted tests in spec/ for both profile-less and build-profile configurations.
- [x] #4 User-facing documentation or help text is updated if the changed `clean` behavior should be documented (or explicitly confirmed unnecessary).
<!-- AC:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Updated clean behavior so `zync clean` removes the entire root build directory while `-c/--clean` pre-clean remains targeted to the selected build dir/profile. Added Busted coverage for profile-less and profile clean behavior plus pre-clean behavior, and updated README/CLI help text to document the change. Tests: busted.
<!-- SECTION:FINAL_SUMMARY:END -->
