Skip to content

feat: Stack-aware constitution templates in /setup #188

Closed

Description

@admarble

Summary

The /sequant:setup skill copies a generic constitution template. For better user experience, we should detect the project's tech stack and either:

  1. Copy a stack-specific template, or
  2. Dynamically inject stack-specific notes

Proposed Approach

Option A: Multiple Templates

memory/
├── constitution.md           # Generic fallback
├── constitution.node.md      # Node.js/TypeScript
├── constitution.python.md    # Python
├── constitution.rust.md      # Rust
└── constitution.go.md        # Go

Option B: Dynamic Injection (Preferred)

Keep single template with a {{STACK_NOTES}} placeholder. Setup skill detects stack and injects relevant notes:

Node.js Detection: package.json exists

  • Testing: Jest, Vitest, Mocha patterns
  • Linting: ESLint, Prettier conventions
  • Build: Common output directories

Python Detection: pyproject.toml, setup.py, requirements.txt

  • Testing: pytest conventions
  • Linting: ruff, black, mypy
  • Virtual environments

Rust Detection: Cargo.toml

  • Testing: cargo test conventions
  • Clippy lints
  • Module organization

Acceptance Criteria

  • Setup skill detects project stack
  • Injects appropriate stack-specific notes
  • Falls back to generic notes if stack unknown
  • Stack notes include testing, linting, and build conventions

Nice to Have

  • Interactive mode asks user to confirm/customize detected stack
  • Support for multi-stack projects (e.g., Node + Python)

Related

Activity

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

    @admarble
    ContributorAuthor

    Implementation Plan

    Approach: Dynamic Injection (Option B)

    Based on analysis of the existing codebase, the infrastructure is already in place:

    • detectStack() in src/lib/stacks.ts - detects project tech stack
    • processTemplate() in src/lib/templates.ts - handles {{VARIABLE}} replacement
    • Constitution template has a ## Stack-Specific Notes section (currently hardcoded)

    Implementation Steps

    1. Add stack notes data - Create STACK_NOTES map in stacks.ts with comprehensive notes for each supported stack:

      • Node.js/TypeScript (Next.js, Astro, SvelteKit, Remix, Nuxt)
      • Python (pytest, ruff, virtual environments)
      • Rust (cargo test, clippy, module organization)
      • Go (go test, golangci-lint, package structure)
    2. Update constitution template - Replace hardcoded Astro notes with {{STACK_NOTES}} placeholder

    3. Update template processing - Modify copyTemplates() to inject appropriate stack notes based on detected/selected stack

    4. Add unit tests - Test stack notes generation and template injection

    AC Mapping

    AC Implementation
    AC-1: Setup skill detects project stack ✅ Already implemented via detectStack()
    AC-2: Injects appropriate stack-specific notes Add STACK_NOTES and inject via template
    AC-3: Falls back to generic notes if stack unknown Generic stack config with minimal notes
    AC-4: Stack notes include testing, linting, build Comprehensive notes for each stack

    Files to Modify

    • src/lib/stacks.ts - Add STACK_NOTES and getStackNotes()
    • templates/memory/constitution.md - Add {{STACK_NOTES}} placeholder
    • src/lib/templates.ts - Inject stack notes in copyTemplates()
    • src/lib/stacks.test.ts - Add tests for new functionality

    Ready to implement.

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

    @admarble
    ContributorAuthor

    /fullsolve Complete

    Issue: #188
    Status: READY_FOR_MERGE

    Summary

    • AC: 4/4 met
    • Tests: 607/607 passed (77 new tests for stack notes)
    • QA: All checks passed
    • Build: Succeeded

    Changes Made

    • Added STACK_NOTES constant with comprehensive notes for 9 stacks
    • Added getStackNotes() function for retrieval with fallback
    • Updated constitution template with {{STACK_NOTES}} placeholder
    • Updated copyTemplates() to inject stack notes during setup

    Iterations

    • Spec: 1
    • Exec: 1
    • QA: 1

    PR: #193


    Ready for human review and merge.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions