Skip to content

feat(#187): Auto-detect project name in /setup skill - #192

Merged
admarble merged 2 commits into
mainfrom
feature/187-feat-auto-detect-project-name-in-setup-skill
Jan 27, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/187-feat-auto-detect-project-name-in-setup-skill

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Adds detectProjectName() function to auto-detect project name from various sources
  • Integrates detection into CLI sequant init flow via templates.ts
  • Enhances /sequant:setup skill with bash-based detection for plugin users

Detection Priority

  1. package.json → name field (Node.js projects)
  2. Cargo.toml → [package] name (Rust projects)
  3. pyproject.toml → [project] name or [tool.poetry] name (Python)
  4. go.mod → module path last segment (Go projects)
  5. Git remote → repo name from origin URL
  6. Directory name → fallback to basename(cwd)

Files Changed

File Change
src/lib/project-name.ts NEW - Detection utility with priority-based source detection
src/lib/project-name.test.ts NEW - 22 unit tests covering all detection sources
src/lib/templates.ts Updated to use detectProjectName() instead of basename()
skills/setup/SKILL.md Enhanced with bash-based detection + sed replacement

Test Plan

  • Unit tests for package.json detection (including scoped packages)
  • Unit tests for Cargo.toml detection
  • Unit tests for pyproject.toml detection (PEP 621 + Poetry)
  • Unit tests for go.mod detection
  • Unit tests for git remote detection (SSH + HTTPS formats)
  • Unit tests for directory fallback
  • Priority order tests (package.json wins over all others)
  • Full test suite passes (588 tests)
  • Build passes

Closes #187

🤖 Generated with Claude Code

- Add src/lib/project-name.ts with detectProjectName() function
- Detection priority: package.json → Cargo.toml → pyproject.toml →
  go.mod → git remote → directory name
- Update templates.ts to use new detection instead of basename(cwd)
- Enhance skills/setup/SKILL.md with bash-based detection for plugins
- Add comprehensive unit tests (22 tests covering all detection sources)

Closes #187

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add AC-3 graceful fallback tests (always returns usable name)
- Add integration tests with processTemplate
- Verify placeholder replacement works end-to-end
- Test scoped package names in templates

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@admarble
admarble merged commit 8c099a2 into main Jan 27, 2026
@admarble
admarble deleted the feature/187-feat-auto-detect-project-name-in-setup-skill branch January 27, 2026 18:08
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.

feat: Auto-detect project name in /setup skill

1 participant