Skip to content

chore: Add skill sync script and improve phase detection #30

Closed

Description

@admarble

Summary

Developer experience improvements identified during v1.1.3 development.

Tasks

1. Add skill sync script (Medium Priority)

Currently, changes to templates/skills/ must be manually copied to .claude/skills/. Add automation:

// package.json
{
  "scripts": {
    "sync:skills": "cp -r templates/skills/* .claude/skills/"
  }
}

Or a more robust script that preserves local modifications.

2. Add security-review label detection (Low Priority)

The /spec skill mentions security-review phase but detectPhasesFromLabels() doesn't detect it.

Add to src/commands/run.ts:

const SECURITY_LABELS = ["security", "auth", "authentication", "permissions", "admin"];

And include in phase detection logic.

3. Add example Recommended Workflow to /spec references (Medium Priority)

Add a reference file showing the expected output format:

templates/skills/spec/references/recommended-workflow.md:

## Recommended Workflow

**Phases:** exec → test → qa
**Quality Loop:** enabled
**Reasoning:** Complex refactor with UI components requires browser testing and iteration.

4. Add tests for parseRecommendedWorkflow() (Low Priority)

The new parsing function lacks unit tests. Add to src/commands/run.test.ts:

  • Test parsing valid workflow output
  • Test handling missing sections
  • Test various phase formats (→, ->, comma-separated)

Acceptance Criteria

  • npm run sync:skills works correctly
  • Security labels trigger appropriate phase detection
  • /spec references include workflow output example
  • parseRecommendedWorkflow has test coverage

Priority

Medium - developer experience and code quality

Activity

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

    @admarble
    ContributorAuthor

    Spec Review: Implementation Plan

    Acceptance Criteria with Verification

    AC Description Verification Method Key Assumption
    AC-1 npm run sync:skills works correctly Manual Test Simple cp -r is sufficient
    AC-2 Security labels trigger phase detection Unit Test security-review is valid Phase
    AC-3 /spec references include workflow example N/A - Trivial File path is correct
    AC-4 parseRecommendedWorkflow has test coverage Unit Test Function can be exported

    Assumptions to Validate (Before Implementation)

    • security-review should be added to Phase type union in types.ts
    • Security-review phase position: after spec, before exec
    • Simple cp -r approach for skill sync (no local mod preservation)

    Implementation Plan

    Phase 1: Skill Sync Script (AC-1)

    • Add sync:skills script to package.json
    • Command: cp -r templates/skills/* .claude/skills/

    Phase 2: Security Label Detection (AC-2)

    • Add SECURITY_LABELS constant to run.ts
    • Labels: ["security", "auth", "authentication", "permissions", "admin"]
    • Modify detectPhasesFromLabels() to detect and add security-review phase
    • Update Phase type in types.ts if needed

    Phase 3: Recommended Workflow Reference (AC-3)

    • Create templates/skills/spec/references/recommended-workflow.md
    • Include format matching parseRecommendedWorkflow() parsing logic

    Phase 4: Unit Tests (AC-4)

    • Export parseRecommendedWorkflow from run.ts
    • Add test cases for:
      • Arrow separators (→, ->)
      • Comma-separated phases
      • Missing sections
      • Quality Loop variations

    Conflict Risk Analysis

    ⚠️ Overlap detected with issue #40 on src/commands/run.ts

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: Well-defined chore issue with 4 independent tasks. No browser testing required.

    Effort Breakdown

    Task Complexity
    Skill sync script Low
    Security label detection Medium
    Workflow reference doc Low
    Unit tests Medium

    Generated by /spec workflow

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

    @admarble
    ContributorAuthor

    Implementation Complete ✅

    AC Coverage Summary

    AC Description Status
    AC-1 npm run sync:skills works correctly ✅ Implemented
    AC-2 Security labels trigger phase detection ✅ Implemented
    AC-3 /spec references include workflow example ✅ Implemented
    AC-4 parseRecommendedWorkflow has test coverage ✅ Implemented

    Files Changed

    • package.json - Added sync:skills script
    • src/commands/run.ts - Added SECURITY_LABELS constant and security-review phase detection in detectPhasesFromLabels()
    • src/commands/run.test.ts - Added 12 new tests for parseRecommendedWorkflow() and detectPhasesFromLabels()
    • src/lib/workflow/types.ts - Added security-review to Phase type union
    • templates/skills/spec/references/recommended-workflow.md - New reference doc with workflow format examples

    Test Results

    • All 252 tests pass
    • Build succeeds

    PR Status

    Created: #55


    Generated by /exec workflow

  5. admarble commented on Jan 10, 2026

    @admarble
    ContributorAuthor

    QA Review: READY_FOR_MERGE ✅

    AC Coverage

    AC Description Status
    AC-1 npm run sync:skills works correctly ✅ MET
    AC-2 Security labels trigger phase detection ✅ MET
    AC-3 /spec references include workflow example ✅ MET
    AC-4 parseRecommendedWorkflow has test coverage ✅ MET

    Coverage: 4/4 AC items fully met

    Quality Metrics

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

    Code Review Summary

    Strengths:

    • Clean implementation following existing patterns
    • Comprehensive test coverage (19 new tests)
    • Thoughtful edge case: security-review only added when spec phase exists
    • Reference doc covers all separator formats and examples
    • Type safety maintained (Phase type + Zod schema updated)

    Issues: None

    Verdict

    All acceptance criteria met with high code quality. Tests pass (252/252), build succeeds.

    Next Steps

    1. Consider CHANGELOG entry for sync:skills command
    2. Merge PR chore(#30): add skill sync script and improve phase detection #55

    Generated by /qa workflow

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