Skip to content

newproject: extract scaffold logic into scripts/scaffold.sh#14

Open
nsmiller2501 wants to merge 2 commits into
scunning1975:mainfrom
nsmiller2501:followup/newproject-scaffold-script
Open

newproject: extract scaffold logic into scripts/scaffold.sh#14
nsmiller2501 wants to merge 2 commits into
scunning1975:mainfrom
nsmiller2501:followup/newproject-scaffold-script

Conversation

@nsmiller2501
Copy link
Copy Markdown

Summary

Follow-on to #4. Hoists the deterministic project-scaffolding logic out of SKILL.md and into a standalone shell script at .claude/skills/newproject/scripts/scaffold.sh. SKILL.md now invokes the script and focuses on the conversational/CLAUDE.md authoring half of the protocol.

What changed

  • New .claude/skills/newproject/scripts/scaffold.sh: 168-line shell script that creates the project root, populates the directory tree, writes the requirements.txt/config.{do,py,R} stubs, and emits a README on first run.
  • SKILL.md shrinks from ~135 → ~50 lines. The deterministic scaffolding steps are replaced with a single bash ~/.claude/skills/newproject/scripts/scaffold.sh <project-name> call. The interactive portions (CLAUDE.md authoring, collaborator prompts, philosophy framing) stay in SKILL.md.

Why

The mkdir / heredoc / file-template logic is purely deterministic — there's no benefit to running it through an LLM each invocation. Extracting it to a shell script makes the scaffold step:

  • Cheaper (no LLM tokens spent on emitting the file tree).
  • Independently testable (bash scripts/scaffold.sh /tmp/test-project exits cleanly or doesn't).
  • Re-runnable without re-prompting Claude.

This mirrors the script-extraction pattern used elsewhere in the skills tree (e.g. /bibcheck/scripts/split_bib.py).

Testing

  • Ran bash scaffold.sh /tmp/newproject-smoke-test and confirmed the resulting tree matches what the previous inline protocol produced.
  • Confirmed SKILL.md's reference to the script path is correct and that no inline scaffolding logic was left behind.

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.

1 participant