Skip to content

Make /test skill configurable and framework-agnostic #17

Closed

Description

@admarble

Problem

The `/test` skill has hardcoded assumptions:

  • `localhost:3000` as dev server URL
  • `npm run dev` as dev command
  • Next.js-specific patterns
  • Requires `mcp__chrome-devtools__*` with no fallback

Current Hardcoded Values

```
mcp__chrome-devtools__navigate_page({url: "http://localhost:3000/..."})
```

Proposed Changes

1. Use constitution.md for configuration

Users define in their constitution:
```markdown

Testing Configuration

2. Stack-aware defaults

During `sequant init`, set defaults based on stack:

Stack Dev Command Default Port
Next.js npm run dev 3000
Astro npm run dev 4321
Vite npm run dev 5173
Generic npm run dev 3000

3. Graceful degradation without chrome-devtools

If MCP not available:

  • Skip browser automation steps
  • Suggest manual testing checklist
  • Still generate test plan

Acceptance Criteria

  • Remove hardcoded localhost:3000
  • Read dev server config from constitution or manifest
  • Handle missing chrome-devtools MCP gracefully
  • Update stack templates with appropriate defaults
  • Document how to configure custom dev server

Priority

Low-Medium - /test is already optional, but should work across frameworks

Activity

  1. added
    enhancement
    on Jan 9, 2026
  2. admarble commented on Jan 10, 2026

    @admarble
    ContributorAuthor

    🎯 Acceptance Criteria with Verification

    AC-1: Remove hardcoded localhost:3000

    Verification: Integration test - init with Astro, verify URLs use port 4321
    Status: Ready - {{DEV_URL}} placeholder already exists, needs consistent usage

    AC-2: Read dev server config from constitution or manifest

    Verification: Integration test - custom DEV_URL in config.json is respected
    Status: Ready - config system exists, needs port extraction for lsof check

    AC-3: Handle missing chrome-devtools MCP gracefully

    Verification: Manual test - run /test without MCP, verify manual checklist generated
    Status: Ready - add fallback workflow section to SKILL.md

    AC-4: Update stack templates with appropriate defaults

    Verification: Unit test - verify each stack has correct default port
    Status: ✅ Already complete - stacks.ts has correct ports (4321 for Astro, 5173 for SvelteKit/Remix, etc.)

    AC-5: Document how to configure custom dev server

    Verification: Manual test - search docs for "dev server" finds instructions
    Status: Ready - add section to docs/customization.md


    📋 Implementation Plan

    Phase 1: Core Fixes

    1. Update lsof -ti:3000 in test/SKILL.md to extract port from {{DEV_URL}}
    2. Add {{PM_RUN}} variable for package manager-aware dev command
    3. Ensure template/skills/test/SKILL.md uses placeholders consistently

    Phase 2: MCP Graceful Fallback

    1. Add section to detect MCP availability
    2. Create manual testing fallback workflow (URLs + steps, no automation)
    3. Maintain test report structure in both modes

    Phase 3: Documentation

    1. Add "Testing Configuration" section to docs/customization.md
    2. Document DEV_URL customization during init and post-init

    🔗 Dependencies & Conflicts


    ⚡ Recommended Workflow

    exec → qa
    

    Skipping /spec - issue is well-defined. No browser testing needed (meta: this is about browser testing config itself).


    🎲 Effort Breakdown

    Component Effort
    Port/PM placeholder fixes Small
    MCP fallback logic Medium
    Documentation Small
    Total ~Medium
  3. admarble commented on Jan 10, 2026

    @admarble
    ContributorAuthor

    📋 Implementation Plan (Updated)

    Building on the previous analysis, here's the refined implementation plan with verification criteria.


    ✅ AC Status Summary

    AC Description Status Verification
    AC-1 Remove hardcoded localhost:3000 Ready Integration test - Astro project uses port 4321
    AC-2 Read dev server config from constitution/manifest Ready Integration test - custom DEV_URL respected
    AC-3 Handle missing chrome-devtools MCP gracefully Ready Manual test - generates checklist without MCP
    AC-4 Update stack templates with appropriate defaults ✅ Complete All stacks have correct ports in stacks.ts
    AC-5 Document how to configure custom dev server Ready Manual test - search docs for "dev server"

    🔧 Implementation Plan

    Phase 1: Variable Enhancement

    1. Add DEV_PORT as derived template variable in src/lib/templates.ts

      • Extract port from DEV_URL during processing
      • Cleaner than inline sed in skill files
    2. Add PM_RUN variable for package manager-aware commands

      • Maps to "npm run", "bun run", "yarn", or "pnpm run"

    Phase 2: Update Test Skill Template
    3. Update templates/skills/test/SKILL.md:

    • Replace lsof -ti:3000 → lsof -ti:{{DEV_PORT}}
    • Replace npm run dev → {{PM_RUN}} dev
    • Sync MCP fallback section from .claude/skills/test/SKILL.md

    Phase 3: Documentation
    4. Add "Testing Configuration" section to docs/customization.md

    • DEV_URL during init
    • Post-init config editing
    • sequant update after changes

    ⚠️ Conflict Analysis

    In-flight work: Issue #40 modifies .claude/skills/test/SKILL.md
    Resolution: No conflict - #17 modifies templates/ (source), #40 modifies .claude/ (project copy)


    ⚡ Recommended Workflow

    exec → qa
    

    Skipping /spec - well-defined, AC-4 already complete, low-risk template/docs changes.


    📊 Effort: Small-Medium

    Component Effort
    Template variables (DEV_PORT, PM_RUN) Small
    Skill template updates Small
    Documentation Small
  4. added a commit that references this issue on Jan 10, 2026
  5. admarble commented on Jan 10, 2026

    @admarble
    ContributorAuthor

    🚀 Implementation Complete

    PR: #57

    AC Coverage Summary

    AC Description Status
    AC-1 Remove hardcoded localhost:3000 ✅ Complete
    AC-2 Read dev server config from constitution/manifest ✅ Complete
    AC-3 Handle missing chrome-devtools MCP gracefully ✅ Complete
    AC-4 Update stack templates with appropriate defaults ✅ Complete (was already done)
    AC-5 Document how to configure custom dev server ✅ Complete

    Key Files Changed

    • templates/skills/test/SKILL.md - Updated with {{DEV_URL}}, {{PM_RUN}} tokens and MCP fallback section
    • .claude/skills/test/SKILL.md - Mirror of template changes for this repo
    • src/commands/init.ts - Added PM_RUN token during initialization
    • src/commands/update.ts - Added PM_RUN migration for existing installs
    • docs/customization.md - Added "Testing Configuration" documentation section
    • .claude/skills/test/references/browser-testing-patterns.md - Updated hardcoded URLs

    Implementation Details

    AC-1 & AC-2: Configurable Dev Server

    • DEV_URL token is set during sequant init based on detected stack
    • PM_RUN token is set based on detected package manager (npm run, bun run, yarn, pnpm run)
    • Port is extracted from DEV_URL for lsof check: DEV_PORT=$(echo "{{DEV_URL}}" | sed -E 's/.*:([0-9]+).*/\1/')

    AC-3: MCP Graceful Fallback

    • Added section 2.4 "MCP Availability Check" to /test skill
    • When Chrome DevTools MCP is unavailable, generates a manual testing checklist with URLs and steps
    • Checklist format maintains consistency with automated test reporting

    AC-5: Documentation

    • Added "Testing Configuration" section to docs/customization.md
    • Documents default values by stack, how to customize, package manager detection, and MCP optional nature

    Checks

    • ✅ npm test - 236 tests passing
    • ✅ npm run build - Clean compilation

    Next Steps

    Ready for /qa review.

  6. admarble commented on Jan 10, 2026

    @admarble
    ContributorAuthor

    🔍 QA Review for Issue #17

    AC Coverage

    AC Description Status Notes
    AC-1 Remove hardcoded localhost:3000 ✅ MET {{DEV_URL}} placeholder used throughout test skill template. Port extraction via sed for lsof check.
    AC-2 Read dev server config from constitution or manifest ✅ MET DEV_URL and PM_RUN tokens stored in .claude/.sequant/config.json, set during init based on detected stack
    AC-3 Handle missing chrome-devtools MCP gracefully ✅ MET Section 2.4 added with MCP availability check and manual testing checklist fallback
    AC-4 Update stack templates with appropriate defaults ✅ MET Verified in stacks.ts: Astro=4321, SvelteKit/Remix=5173, Next.js/Nuxt=3000, etc.
    AC-5 Document how to configure custom dev server ✅ MET New "Testing Configuration" section in docs/customization.md with table of defaults, customization steps, and PM detection

    Coverage: 5/5 AC items fully met


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 ✅ OK
    Deleted tests 0 ✅ OK
    Files changed 7 ✅ OK
    Lines added +251 -
    Lines deleted -20 -
    Tests 236 passing ✅ OK
    Build Clean ✅ OK

    Code Review

    Strengths:

    • Clean implementation using template tokens ({{DEV_URL}}, {{PM_RUN}}) rather than conditional logic
    • Migration path for existing installs in update.ts - automatically adds PM_RUN token
    • Comprehensive documentation in docs/customization.md with table of all stacks and defaults
    • MCP fallback is well-documented with a clear manual testing template format
    • Test updated to verify new PM_RUN token behavior

    Issues:

    • Minor: fullsolve/SKILL.md still has npm run dev & hardcoded (out of scope for this issue but worth noting for future)

    Verdict: ✅ READY_FOR_MERGE

    All 5 acceptance criteria are fully met. The implementation is clean, well-tested (236 tests passing), and includes proper migration support for existing installations. Documentation is comprehensive. No security concerns identified.

    Next Steps

    1. Run /docs 17 if additional documentation needed
    2. Consider adding CHANGELOG entry for the /test skill configurability improvement
    3. Merge when ready

    Documentation: Before merging, consider running /docs 17 to generate any additional feature documentation.

    🤖 Generated with Claude Code QA

  7. added
    ready-for-review
    on Jan 10, 2026
  8. added a commit that references this issue on Jan 10, 2026
  9. added 2 commits that reference this issue on Jan 10, 2026
  10. added 2 commits that reference 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

    enhancementready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions