Skip to content

Aidd issue 139#140

Draft
ericelliott wants to merge 4 commits intomainfrom
cursor/aidd-issue-139-5ed9
Draft

Aidd issue 139#140
ericelliott wants to merge 4 commits intomainfrom
cursor/aidd-issue-139-5ed9

Conversation

@ericelliott
Copy link
Collaborator

Fixes #139

This PR addresses an issue where aidd create was extracting GitHub release tarballs to a global directory (~/.aidd/scaffold/) instead of the project-specific directory (<folder>/.aidd/scaffold/). This caused template files to be inaccessible during manifest steps.

Changes include:

  • lib/scaffold-create.js: Now passes scaffoldDownloadDir to resolveExtensionFn to ensure release files are extracted to <folder>/.aidd/scaffold/.
  • lib/scaffold-cleanup.js: Updated to remove the project-scoped <folder>/.aidd/ directory, consistent with the new extraction behavior.
  • lib/scaffold-commands.js: Added an optional [folder] argument to scaffold-cleanup for explicit path specification.
  • Tests: Updated scaffold-cleanup.test.js, scaffold-create.test.js, and bin/create-e2e.test.js to reflect the project-scoped behavior. All unit and E2E tests pass.
Open in Web Open in Cursor 

When creating from a GitHub release URL, runCreate was not passing
scaffoldDownloadDir to resolveExtensionFn, so tarball contents were
extracted to the global ~/.aidd/scaffold/ instead of
<folder>/.aidd/scaffold/. Template files from the release tarball were
therefore inaccessible when manifest steps executed inside the project
folder.

Changes:
- scaffold-create.js: pass scaffoldDownloadDir: path.join(folder,
  ".aidd", "scaffold") to resolveExtensionFn so downloaded scaffold
  files land inside the project directory
- scaffold-cleanup.js: accept a folder parameter (defaulting to
  process.cwd()) and remove <folder>/.aidd/ instead of the global
  ~/.aidd/scaffold/
- scaffold-commands.js: add [folder] optional argument to the
  scaffold-cleanup command and resolve it before passing to
  scaffoldCleanup
- Tests updated to cover the new project-scoped download directory and
  folder-scoped cleanup behaviour
- Epic updated with the new requirement

Closes #139
@cursor
Copy link
Contributor

cursor bot commented Mar 10, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Closes #139. Scaffold files (template files, SCAFFOLD-MANIFEST.yml,
README.md, etc.) were never copied into the project directory. For
downloaded scaffolds they sat unused in ~/.aidd/scaffold/; for named
and file:// scaffolds they remained at their on-disk source locations.
Manifest steps running inside <folder> therefore had no access to any
template files.

Changes:
- scaffold-create.js: copy all files from the scaffold source directory
  into <folder>/ (via injectable copyFn = fs.copy) for every scaffold
  type (named, file://, downloaded)
- scaffold-create.js: run the manifest from <folder>/SCAFFOLD-MANIFEST.yml
  in all cases so there is no branching on scaffold type
- scaffold-create.js: pre-flight check — throw ScaffoldValidationError
  if <folder> already exists before resolving or downloading anything
- scaffold-cleanup.js / scaffold-commands.js: reverted the wrong
  download-location change from the previous commit; cleanup still
  targets ~/.aidd/scaffold/
- Tests: added unit tests for copy behaviour (all scaffold types),
  manifest path resolution, and folder-exists guard; added E2E tests
  verifying scaffold files land in the project directory and that an
  existing target folder is rejected
npm init -y in a scaffold manifest is an anti-pattern: since npx aidd
create now copies scaffold source files into the project folder first,
the template package.json is already in place before any steps run.
Running npm init -y on top of it is redundant and misleading.

Changes:
- SCAFFOLD-MANIFEST.yml: remove npm init -y and npm pkg set steps;
  manifest is now a single npm install --save-dev step
- package.json: redesign as a project template — pre-configured with
  type:module, test and release scripts; no scaffold-specific name or
  files field
- README.md: update description to reflect template-first approach
- docs/scaffold-authoring.md: replace npm init -y example with the
  template pattern; add tip explaining copy-then-install ordering
- tasks epic: update scaffold-example requirements
- E2E test: add assertion that manifest does not contain npm init -y,
  and that the generated project has type:module from the template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(aidd create): Scaffold files not being copied from release

2 participants