Skip to content

Configure placeholder tokens during onboarding #18

Closed

Description

@admarble

Summary

During the cleanup of project-specific content, placeholder tokens were introduced that need to be configured during sequant init:

  • {{DEV_URL}} - Development server URL (e.g., http://localhost:3000, http://localhost:4321)

Current State

The /test skill uses {{DEV_URL}} as a placeholder in browser test examples:

mcp__chrome-devtools__navigate_page({url: "{{DEV_URL}}/admin/..."})

This token is not replaced during initialization, so users see the raw placeholder.

Acceptance Criteria

  • AC-1: sequant init prompts for dev server URL (with smart default based on stack)
  • AC-2: Tokens are replaced in skill templates during initialization
  • AC-3: Token values stored in .claude/.sequant/config.json for reference
  • AC-4: sequant update preserves user-configured token values

Implementation Notes

Smart Defaults by Stack

Stack Default DEV_URL
Next.js http://localhost:3000
Astro http://localhost:4321
Vite http://localhost:5173
Python/Flask http://localhost:5000
Python/Django http://localhost:8000
Go http://localhost:8080
Rust/Actix http://localhost:8080
Generic http://localhost:3000

Config File Structure

{
  "tokens": {
    "DEV_URL": "http://localhost:3000"
  },
  "stack": "nextjs",
  "initialized": "2025-01-07T..."
}

Related

Activity

  1. admarble commented on Jan 8, 2026

    @admarble
    ContributorAuthor

    📋 Phase 1 Plan: Configure Placeholder Tokens During Onboarding

    Acceptance Criteria with Verification

    AC-1: sequant init prompts for dev server URL (with smart default based on stack)

    Verification Method: Integration Test + Manual Test

    Test Scenario:

    • Given: A fresh project directory with Next.js configuration
    • When: User runs sequant init
    • Then:
      • Stack is detected as Next.js
      • User is prompted for dev server URL with default http://localhost:3000
      • User can accept default or enter custom URL

    Smart Defaults by Stack:

    Stack Default DEV_URL
    Next.js http://localhost:3000
    Astro http://localhost:4321
    Vite http://localhost:5173
    Python http://localhost:5000
    Go http://localhost:8080
    Rust http://localhost:8080
    Generic http://localhost:3000

    AC-2: Tokens are replaced in skill templates during initialization

    Verification Method: Integration Test

    Test Scenario:

    • Given: Template file contains {{DEV_URL}} placeholder
    • When: sequant init completes
    • Then:
      • .claude/skills/test/SKILL.md contains the actual URL
      • No {{DEV_URL}} placeholder remains in copied files

    AC-3: Token values stored in .claude/.sequant/config.json for reference

    Verification Method: Integration Test

    Test Scenario:

    • Given: User completes sequant init with dev URL http://localhost:4321
    • When: Initialization completes
    • Then:
      • File .claude/.sequant/config.json exists
      • Contains: { "tokens": { "DEV_URL": "http://localhost:4321" }, "stack": "astro", "initialized": "..." }

    AC-4: sequant update preserves user-configured token values

    Verification Method: Integration Test

    Test Scenario:

    • Given: Project initialized with DEV_URL: http://localhost:4000
    • When: User runs sequant update
    • Then:
      • Templates updated with latest content
      • {{DEV_URL}} replaced with preserved http://localhost:4000
      • Config file unchanged

    Implementation Plan

    Phase 1: Add Config Module (Foundation)

    1. Create src/lib/config.ts with:

      • Interface SequantConfig with tokens, stack, initialized fields
      • getConfig() / saveConfig() functions
      • Config path: .claude/.sequant/config.json
    2. Add DEV_URL defaults to src/lib/stacks.ts:

      • Extend StackConfig interface with devUrl field
      • Add default URLs per stack

    Phase 2: Update Init Command

    1. Modify src/commands/init.ts:

      • Prompt for dev URL after stack selection (using inquirer)
      • Show stack-specific default
      • Create .claude/.sequant/ directory
      • Save config before copying templates
    2. Update src/lib/templates.ts copyTemplates():

      • Accept tokens parameter or read from config
      • Merge tokens into template variables

    Phase 3: Update Command Enhancement

    1. Modify src/commands/update.ts:

      • Read existing config at start
      • Pass saved tokens to template processing
      • Preserve config during updates
    2. Apply tokens during file updates:

      • Use getConfig() to retrieve saved DEV_URL
      • Process templates with saved tokens

    Phase 4: Testing

    1. Unit tests for config module
    2. Integration tests for init with token prompting
    3. Integration tests for update with token preservation

    Assumptions to Validate

    • Existing processTemplate() function handles new token correctly
    • Only {{DEV_URL}} token exists in templates currently
    • .claude/.sequant/ path doesn't conflict with existing structure
    • --yes flag should auto-accept stack default for non-interactive installs

    Open Questions

    1. Should --yes flag auto-accept default dev URL?

      • Recommendation: Yes, use stack default for CI/automation
    2. Legacy installs without config - what happens on update?

      • Recommendation: Prompt for token values, then save config (migration path)
    3. Should Vite be added as a detected stack?

      • Recommendation: Yes, since it has distinct port (5173)

    Files to Modify

    File Changes
    src/lib/config.ts New - Config read/write functions
    src/lib/stacks.ts Add devUrl to StackConfig interface and defaults
    src/commands/init.ts Add dev URL prompt, save config
    src/lib/templates.ts Accept tokens in copyTemplates()
    src/commands/update.ts Read config, preserve tokens during updates

    Effort: ~2-3 hours implementation + testing

    🤖 Generated with Claude Code

  2. admarble commented on Jan 8, 2026

    @admarble
    ContributorAuthor

    📋 Refined Implementation Plan (Spec v2)

    Acceptance Criteria with Verification

    AC-1: sequant init prompts for dev server URL (with smart default based on stack)

    Verification Method: Integration Test + Manual Test

    Test Scenario:

    Smart Defaults by Stack:

    Stack Default DEV_URL
    Next.js http://localhost:3000
    Astro http://localhost:4321
    Python http://localhost:5000
    Go http://localhost:8080
    Rust http://localhost:8080
    Generic http://localhost:3000

    AC-2: Tokens are replaced in skill templates during initialization

    Verification Method: Integration Test

    Test Scenario:

    • Given: Template templates/skills/test/SKILL.md contains {{DEV_URL}} placeholder (line 187)
    • When: sequant init completes with DEV_URL=http://localhost:4321
    • Then:
      • .claude/skills/test/SKILL.md contains the actual URL
      • No {{DEV_URL}} placeholder remains in copied files

    Note: Existing processTemplate() function at src/lib/templates.ts:24 already handles {{KEY}} substitution - just need to pass the token.


    AC-3: Token values stored in .claude/.sequant/config.json for reference

    Verification Method: Integration Test

    Test Scenario:

    • Given: User completes sequant init with Astro stack and custom URL
    • When: Initialization completes
    • Then: File .claude/.sequant/config.json exists with:
      {
        "tokens": { "DEV_URL": "http://localhost:4321" },
        "stack": "astro",
        "initialized": "2026-01-08T..."
      }

    AC-4: sequant update preserves user-configured token values

    Verification Method: Integration Test

    Test Scenario:

    • Given: Project initialized with DEV_URL: http://localhost:4000
    • When: User runs sequant update
    • Then:
      • Templates updated with latest content
      • {{DEV_URL}} replaced with preserved http://localhost:4000
      • Config file unchanged

    Migration Path: Legacy installs without config prompt for DEV_URL on first update.


    Implementation Plan

    Phase 1: Config Module (Foundation)

    1. Create src/lib/config.ts

      • Interface: SequantConfig { tokens, stack, initialized }
      • Functions: getConfig(), saveConfig(config)
      • Path: .claude/.sequant/config.json
    2. Add devUrl to src/lib/stacks.ts

      • Extend StackConfig interface with devUrl: string
      • Add default URLs per stack

    Phase 2: Init Command Enhancement

    1. Modify src/commands/init.ts

      • Add dev URL prompt after stack selection
      • Create .claude/.sequant/ directory
      • Save config before copying templates
      • Pass tokens to copyTemplates()
    2. Update src/lib/templates.ts

      • Change signature: copyTemplates(stack, tokens?)
      • Merge tokens into template variables

    Phase 3: Update Command Enhancement

    1. Modify src/commands/update.ts

      • Read config at start
      • Migration: prompt for tokens if config missing
      • Export processTemplate() for use in update
    2. Apply tokens during file updates

      • Process template content with saved tokens before writing

    Phase 4: Exports and Testing

    1. Update src/index.ts exports
    2. Unit tests for config module
    3. Integration tests for init/update with tokens

    Files to Modify

    File Changes
    src/lib/config.ts New - Config read/write functions
    src/lib/stacks.ts Add devUrl to StackConfig and defaults
    src/commands/init.ts Add dev URL prompt, save config
    src/lib/templates.ts Accept tokens in copyTemplates(), export processTemplate()
    src/commands/update.ts Read config, apply tokens during updates
    src/index.ts Export config functions

    Assumptions Validated

    • ✅ processTemplate() handles {{KEY}} pattern (line 30)
    • ✅ Only {{DEV_URL}} exists as unreplaced token (grep confirmed: only in test/SKILL.md)
    • ✅ inquirer is already a dependency
    • ✅ .claude/.sequant/ path is unused (no conflicts)

    Open Questions (with Recommendations)

    1. --yes flag behavior? → Auto-accept stack default ✅
    2. Legacy install migration? → Prompt on first update ✅
    3. Add Vite stack? → Defer to follow-up issue (keep focused)

    🤖 Generated with Claude Code

  3. added a commit that references this issue on Jan 8, 2026
    4c03548
  4. admarble commented on Jan 8, 2026

    @admarble
    ContributorAuthor

    🚀 Implementation Complete

    AC Coverage Summary

    AC Description Status
    AC-1 sequant init prompts for dev server URL with smart stack defaults ✅ Implemented
    AC-2 Tokens replaced in skill templates during initialization ✅ Implemented
    AC-3 Token values stored in .claude/.sequant/config.json ✅ Implemented
    AC-4 sequant update preserves user-configured token values ✅ Implemented

    Files Changed

    File Changes
    src/lib/config.ts New - Config read/write functions (getConfig, saveConfig)
    src/lib/stacks.ts Added devUrl field to StackConfig interface and all stack defaults
    src/commands/init.ts Added dev URL prompt, config saving, pass tokens to templates
    src/lib/templates.ts copyTemplates() now accepts optional tokens, exported processTemplate()
    src/commands/update.ts Read config, legacy migration, process templates with tokens
    src/index.ts Export new config functions and types
    src/commands/init.test.ts Updated tests for new mocks

    Smart Defaults by Stack

    Stack Default DEV_URL
    Next.js http://localhost:3000
    Astro http://localhost:4321
    Python http://localhost:5000
    Go http://localhost:8080
    Rust http://localhost:8080
    Generic http://localhost:3000

    Test/Build Results

    • ✅ npm run build - Passed
    • ✅ npm test - 144 tests passed (6 test files)

    Branch Ready for PR

    feature/18-configure-placeholder-tokens-during-onboarding


    🤖 Generated with Claude Code

  5. added 2 commits that reference this issue on Jan 9, 2026
  6. added a commit that references this issue on Sep 9, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions