Skip to content

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

Merged
admarble merged 3 commits into
mainfrom
feature/188-feat-stack-aware-constitution-templates-in-set
Jan 29, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/188-feat-stack-aware-constitution-templates-in-set

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Add STACK_NOTES map with comprehensive testing, linting, and build notes for each supported stack
  • Add getStackNotes() function to retrieve stack-specific notes
  • Update constitution template to use {{STACK_NOTES}} placeholder
  • Inject appropriate notes during setup based on detected/selected stack

Supported Stacks

Stack Testing Linting Build
Next.js Jest/Vitest + RTL, next/jest eslint-config-next .next/
Astro Vitest eslint-plugin-astro dist/
SvelteKit Vitest + testing-library/svelte eslint-plugin-svelte adapter-dependent
Remix Vitest/Jest + RTL ESLint build/
Nuxt Vitest + @nuxt/test-utils @nuxt/eslint-config .output/
Rust cargo test cargo clippy target/
Python pytest ruff python -m build
Go go test golangci-lint go build
Generic Fallback guidance Common tools Common patterns

Acceptance Criteria

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

Test Plan

  • Unit tests verify all stacks have notes
  • Tests verify each stack includes Testing, Linting, and Build sections
  • Tests verify fallback to generic notes for unknown stacks
  • Full test suite passes (607 tests)
  • Build succeeds

Fixes #188

🤖 Generated with Claude Code

- Add STACK_NOTES map with comprehensive notes for each supported stack:
  - Next.js, Astro, SvelteKit, Remix, Nuxt (JS frameworks)
  - Rust, Python, Go (system languages)
  - Generic fallback for unknown stacks
- Add getStackNotes() function to retrieve stack-specific notes
- Update constitution template to use {{STACK_NOTES}} placeholder
- Inject stack notes via copyTemplates() during setup
- Add 77 tests covering all stacks and notes content

Each stack's notes include:
- Testing conventions and frameworks
- Linting tools and commands
- Build output directories and commands

Fixes #188

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@admarble

Copy link
Copy Markdown
Contributor Author

QA Review for PR #193

AC Coverage

AC Description Status Notes
AC-1 Setup skill detects project stack MET detectStack() in stacks.ts detects all supported stacks via config files and package.json deps
AC-2 Injects appropriate stack-specific notes MET copyTemplates() now calls getStackNotes(stack) and injects STACK_NOTES variable
AC-3 Falls back to generic notes if stack unknown MET getStackNotes() returns STACK_NOTES.generic for unknown stacks
AC-4 Stack notes include testing, linting, and build conventions MET Each stack's notes include Testing, Linting, and Build sections (verified by tests)

Coverage: 4/4 AC items fully met


Quality Metrics

Metric Value Status
Type issues (any) 0 ✅ OK
Deleted tests 0 ✅ OK
Files changed 4 ✅ OK
Lines added +277 -
Lines deleted -6 -

Test Coverage Analysis

Changed File Tier Has Tests? Test File
src/lib/stacks.ts Standard ✅ Yes src/lib/stacks.test.ts
src/lib/templates.ts Standard ✅ Yes src/lib/templates.test.ts
templates/memory/constitution.md Optional N/A Template file

Coverage: 2/2 changed source files have corresponding tests
Critical paths without tests: None


Code Review

Strengths:

  • Clean implementation with well-documented STACK_NOTES map covering 9 stacks
  • getStackNotes() provides safe fallback to generic notes
  • Comprehensive test suite with 77 new tests covering all stacks
  • Minimal changes to templates.ts - just imports and one variable injection
  • Template change is simple placeholder replacement

Issues:

  • None identified

Suggestions:

  • None - implementation is clean and well-tested

Test Quality Review

Category Status Notes
Behavior vs Implementation ✅ OK Tests verify stack notes content and function behavior
Coverage Depth ✅ OK Tests cover all 9 stacks, edge cases (unknown stack, empty string)
Mock Hygiene ✅ OK Only mocks fs module for file operations
Test Reliability ✅ OK No timing dependencies, deterministic tests

Issues Found: None


Anti-Pattern Detection

Dependency Audit

N/A - No dependency changes

Code Patterns

File:Line Category Pattern Status
- - - No anti-patterns detected

Critical Issues: 0
Warnings: 0


Execution Evidence

N/A - No executable changes (scripts/CLI not modified)


Self-Evaluation

  • Verified working: Yes - All 608 tests pass, build succeeds, new feature is purely additive
  • Test efficacy: High - Tests explicitly verify each stack has notes with Testing/Linting/Build sections
  • Likely failure mode: Missing stack in STACK_NOTES map (mitigated by generic fallback)
  • Verdict confidence: High - Simple, well-tested feature with clear scope

Verdict: READY_FOR_MERGE

All acceptance criteria are met with high-quality implementation:

  • 77 new tests added covering all stacks and edge cases
  • Clean code following existing patterns
  • Safe fallback behavior for unknown stacks
  • No security concerns

Documentation

  • N/A - Feature is internal (constitution template generation during /setup)

Next Steps

  1. Merge PR
  2. Feature will be available in next release

🤖 QA performed by Claude Opus 4.5

@admarble

Copy link
Copy Markdown
Contributor Author

QA Update: Gaps Addressed ✅

Gap 1: CHANGELOG Updated

  • Added entry for stack-aware constitution templates in [Unreleased] section
  • Commit: e760e59

Gap 2: End-to-End Smoke Test Passed

Detected stack: nextjs

=== Verification ===
Has Next.js notes: true
Has Jest mention: true
Has next/jest mention: true
Has eslint-config-next: true
Has .next/ directory: true
Placeholder removed: YES - PASS

Verified copyTemplates() correctly:

  1. Detects Next.js from package.json dependencies
  2. Retrieves Next.js-specific notes via getStackNotes()
  3. Injects notes into constitution template
  4. Replaces {{STACK_NOTES}} placeholder with actual content

Gap 3: Follow-up Issue Created


Updated Verdict: READY_FOR_MERGE ✅

All gaps addressed. PR is ready for merge.

@admarble
admarble merged commit 9469aa3 into main Jan 29, 2026
6 checks passed
@admarble
admarble deleted the feature/188-feat-stack-aware-constitution-templates-in-set branch January 29, 2026 07:11
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: Stack-aware constitution templates in /setup

1 participant