Skip to content

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

Closed

Description

@admarble

Summary

The /sequant:setup skill copies a constitution template with {{PROJECT_NAME}} placeholder that users must manually replace. We should auto-detect the project name and fill it in automatically.

Detection Sources (priority order)

  1. package.json → name field
  2. Cargo.toml → [package] name
  3. pyproject.toml → [project] name or [tool.poetry] name
  4. go.mod → module name
  5. Git remote URL → extract repo name
  6. Current directory name (fallback)

Acceptance Criteria

  • Setup skill detects project name from available sources
  • Replaces {{PROJECT_NAME}} in copied constitution.md
  • Falls back gracefully if no name detected (keeps placeholder)
  • Works across Node.js, Rust, Python, Go projects

Technical Notes

  • Detection should happen in the setup skill before copying
  • Use sed or similar to replace placeholder after copy
  • Consider caching detected project info for other skills

Related

Activity

  1. added
    enhancement
    on Jan 27, 2026
  2. admarble commented on Jan 27, 2026

    @admarble
    ContributorAuthor

    📋 Plan: Auto-detect Project Name in /setup Skill

    Acceptance Criteria

    AC Description Verification
    AC-1 Setup skill detects project name from available sources Unit + Integration Test
    AC-2 Replaces {{PROJECT_NAME}} in copied constitution.md Integration Test
    AC-3 Falls back gracefully if no name detected Unit Test
    AC-4 Works across Node.js, Rust, Python, Go projects Parameterized Unit Tests

    Detection Priority

    1. package.json → name field
    2. Cargo.toml → [package] name
    3. pyproject.toml → [project] name OR [tool.poetry] name
    4. go.mod → module path (last segment)
    5. git remote → extract repo name from origin URL
    6. Directory name → basename(cwd) (fallback)
    

    Implementation Plan

    Phase 1: Create Detection Utility

    • Create src/lib/project-name.ts with detectProjectName() function
    • Implement priority-based detection with proper parsing

    Phase 2: Integrate with CLI

    • Update src/lib/templates.ts to use new detection
    • Replace basename(process.cwd()) with detectProjectName()

    Phase 3: Update Setup Skill

    • Enhance skills/setup/SKILL.md with bash-based detection
    • Add sed replacement step after constitution copy

    Phase 4: Testing

    • Add unit tests for each detection source
    • Add fallback behavior tests
    • Add integration test with file fixtures

    Files to Modify

    File Change
    src/lib/project-name.ts NEW - Detection utility
    src/lib/templates.ts Use detectProjectName()
    skills/setup/SKILL.md Add detection + replacement steps
    src/lib/__tests__/project-name.test.ts NEW - Unit tests

    Assumptions

    • TOML files can be parsed with regex for simple key extraction
    • Git remote URL follows standard GitHub/GitLab format

    Ready for implementation via /exec 187

  3. added
    planned
    cli
    on Jan 27, 2026
  4. added a commit that references this issue on Jan 27, 2026
  5. admarble commented on Jan 27, 2026

    @admarble
    ContributorAuthor

    ✅ /fullsolve Complete

    AC Coverage

    AC Description Status
    AC-1 Setup skill detects project name from available sources ✅ MET
    AC-2 Replaces {{PROJECT_NAME}} in copied constitution.md ✅ MET
    AC-3 Falls back gracefully if no name detected ✅ MET
    AC-4 Works across Node.js, Rust, Python, Go projects ✅ MET

    Quality Metrics

    • Tests: 589 passed (22 new for project-name)
    • Build: ✅ Passed
    • Type issues: 0
    • Deleted tests: 0

    Implementation Summary

    Created src/lib/project-name.ts with priority-based detection:

    1. package.json → name field
    2. Cargo.toml → [package] name
    3. pyproject.toml → [project] name OR [tool.poetry] name
    4. go.mod → module path (last segment)
    5. git remote → repo name from origin URL
    6. Directory name → fallback

    Verdict: READY_FOR_MERGE

    PR: #192


    🤖 Generated with Claude Code

  6. added
    ready-for-review
    on Jan 27, 2026
  7. added a commit that references this issue on Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clienhancementplannedready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions