sequant 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +237 -0
  3. package/dist/bin/cli.d.ts +8 -0
  4. package/dist/bin/cli.d.ts.map +1 -0
  5. package/dist/bin/cli.js +70 -0
  6. package/dist/bin/cli.js.map +1 -0
  7. package/dist/src/commands/doctor.d.ts +8 -0
  8. package/dist/src/commands/doctor.d.ts.map +1 -0
  9. package/dist/src/commands/doctor.js +171 -0
  10. package/dist/src/commands/doctor.js.map +1 -0
  11. package/dist/src/commands/init.d.ts +11 -0
  12. package/dist/src/commands/init.d.ts.map +1 -0
  13. package/dist/src/commands/init.js +124 -0
  14. package/dist/src/commands/init.js.map +1 -0
  15. package/dist/src/commands/run.d.ts +18 -0
  16. package/dist/src/commands/run.d.ts.map +1 -0
  17. package/dist/src/commands/run.js +229 -0
  18. package/dist/src/commands/run.js.map +1 -0
  19. package/dist/src/commands/status.d.ts +5 -0
  20. package/dist/src/commands/status.d.ts.map +1 -0
  21. package/dist/src/commands/status.js +45 -0
  22. package/dist/src/commands/status.js.map +1 -0
  23. package/dist/src/commands/update.d.ts +10 -0
  24. package/dist/src/commands/update.d.ts.map +1 -0
  25. package/dist/src/commands/update.js +124 -0
  26. package/dist/src/commands/update.js.map +1 -0
  27. package/dist/src/index.d.ts +15 -0
  28. package/dist/src/index.d.ts.map +1 -0
  29. package/dist/src/index.js +13 -0
  30. package/dist/src/index.js.map +1 -0
  31. package/dist/src/lib/fs.d.ts +10 -0
  32. package/dist/src/lib/fs.d.ts.map +1 -0
  33. package/dist/src/lib/fs.js +44 -0
  34. package/dist/src/lib/fs.js.map +1 -0
  35. package/dist/src/lib/manifest.d.ts +14 -0
  36. package/dist/src/lib/manifest.d.ts.map +1 -0
  37. package/dist/src/lib/manifest.js +37 -0
  38. package/dist/src/lib/manifest.js.map +1 -0
  39. package/dist/src/lib/stacks.d.ts +22 -0
  40. package/dist/src/lib/stacks.d.ts.map +1 -0
  41. package/dist/src/lib/stacks.js +131 -0
  42. package/dist/src/lib/stacks.js.map +1 -0
  43. package/dist/src/lib/templates.d.ts +16 -0
  44. package/dist/src/lib/templates.d.ts.map +1 -0
  45. package/dist/src/lib/templates.js +118 -0
  46. package/dist/src/lib/templates.js.map +1 -0
  47. package/dist/src/lib/workflow/cli-args.d.ts +138 -0
  48. package/dist/src/lib/workflow/cli-args.d.ts.map +1 -0
  49. package/dist/src/lib/workflow/cli-args.js +210 -0
  50. package/dist/src/lib/workflow/cli-args.js.map +1 -0
  51. package/dist/src/lib/workflow/execute-issues.d.ts +42 -0
  52. package/dist/src/lib/workflow/execute-issues.d.ts.map +1 -0
  53. package/dist/src/lib/workflow/execute-issues.js +463 -0
  54. package/dist/src/lib/workflow/execute-issues.js.map +1 -0
  55. package/dist/src/lib/workflow/logger.d.ts +168 -0
  56. package/dist/src/lib/workflow/logger.d.ts.map +1 -0
  57. package/dist/src/lib/workflow/logger.js +249 -0
  58. package/dist/src/lib/workflow/logger.js.map +1 -0
  59. package/dist/src/lib/workflow/types.d.ts +89 -0
  60. package/dist/src/lib/workflow/types.d.ts.map +1 -0
  61. package/dist/src/lib/workflow/types.js +23 -0
  62. package/dist/src/lib/workflow/types.js.map +1 -0
  63. package/package.json +69 -0
  64. package/stacks/go.yaml +22 -0
  65. package/stacks/nextjs.yaml +28 -0
  66. package/stacks/python.yaml +24 -0
  67. package/stacks/rust.yaml +23 -0
  68. package/templates/hooks/post-tool.sh +301 -0
  69. package/templates/hooks/pre-tool.sh +350 -0
  70. package/templates/memory/constitution.md +60 -0
  71. package/templates/scripts/cleanup-worktree.sh +78 -0
  72. package/templates/scripts/list-worktrees.sh +50 -0
  73. package/templates/scripts/new-feature.sh +156 -0
  74. package/templates/settings.json +26 -0
  75. package/templates/skills/assess/SKILL.md +428 -0
  76. package/templates/skills/clean/SKILL.md +196 -0
  77. package/templates/skills/docs/SKILL.md +323 -0
  78. package/templates/skills/exec/SKILL.md +426 -0
  79. package/templates/skills/fullsolve/SKILL.md +479 -0
  80. package/templates/skills/loop/SKILL.md +310 -0
  81. package/templates/skills/qa/SKILL.md +261 -0
  82. package/templates/skills/qa/references/code-quality-exemplars.md +112 -0
  83. package/templates/skills/qa/references/code-review-checklist.md +77 -0
  84. package/templates/skills/qa/references/quality-gates.md +95 -0
  85. package/templates/skills/qa/references/testing-requirements.md +109 -0
  86. package/templates/skills/qa/scripts/quality-checks.sh +109 -0
  87. package/templates/skills/reflect/SKILL.md +159 -0
  88. package/templates/skills/reflect/references/documentation-tiers.md +70 -0
  89. package/templates/skills/reflect/references/phase-reflection.md +95 -0
  90. package/templates/skills/reflect/scripts/workflow-queries.ts +165 -0
  91. package/templates/skills/security-review/SKILL.md +344 -0
  92. package/templates/skills/security-review/references/security-checklists.md +377 -0
  93. package/templates/skills/solve/SKILL.md +242 -0
  94. package/templates/skills/spec/SKILL.md +169 -0
  95. package/templates/skills/spec/references/parallel-groups.md +72 -0
  96. package/templates/skills/spec/references/verification-criteria.md +104 -0
  97. package/templates/skills/test/SKILL.md +508 -0
  98. package/templates/skills/testgen/SKILL.md +561 -0
  99. package/templates/skills/verify/SKILL.md +266 -0
@@ -0,0 +1,60 @@
1
+ # {{PROJECT_NAME}} Constitution
2
+
3
+ This document defines the core principles and patterns for AI-assisted development in this project.
4
+
5
+ ## Core Principles
6
+
7
+ 1. **Quality First** - Never sacrifice code quality for speed
8
+ 2. **Test Everything** - All features must have appropriate test coverage
9
+ 3. **Document Decisions** - Important decisions should be captured in issue comments
10
+ 4. **Incremental Progress** - Break large tasks into small, reviewable chunks
11
+ 5. **Respect Existing Patterns** - Follow established project conventions
12
+
13
+ ## Workflow Phases
14
+
15
+ ### Phase 1: Planning (`/spec`)
16
+ - Understand requirements and acceptance criteria
17
+ - Identify potential risks and dependencies
18
+ - Draft implementation plan for approval
19
+
20
+ ### Phase 2: Implementation (`/exec`)
21
+ - Work in feature worktree
22
+ - Follow established patterns
23
+ - Keep commits atomic and well-described
24
+
25
+ ### Phase 3: Quality (`/qa`)
26
+ - Review against acceptance criteria
27
+ - Run all quality checks
28
+ - Address feedback before merge
29
+
30
+ ## Code Standards
31
+
32
+ ### Naming Conventions
33
+ - Use descriptive variable and function names
34
+ - Follow language-specific conventions (camelCase, snake_case, etc.)
35
+
36
+ ### Error Handling
37
+ - Handle errors gracefully
38
+ - Log meaningful error messages
39
+ - Don't swallow exceptions silently
40
+
41
+ ### Testing
42
+ - Write tests for new features
43
+ - Update tests when modifying existing code
44
+ - Test edge cases and error paths
45
+
46
+ ## Commands Available
47
+
48
+ | Command | Purpose |
49
+ |---------|---------|
50
+ | `/spec` | Plan implementation for an issue |
51
+ | `/exec` | Implement a planned feature |
52
+ | `/test` | Run browser-based UI tests |
53
+ | `/qa` | Quality review before merge |
54
+ | `/loop` | Fix iteration when tests fail |
55
+ | `/docs` | Generate feature documentation |
56
+
57
+ ## Project-Specific Notes
58
+
59
+ <!-- Add your project-specific guidelines below -->
60
+
@@ -0,0 +1,78 @@
1
+ #!/bin/bash
2
+
3
+ # Clean up a worktree after PR is merged
4
+ # Usage: ./scripts/cleanup-worktree.sh <branch-name>
5
+ # Example: ./scripts/cleanup-worktree.sh feature/4-build-shop-detail-pages
6
+
7
+ set -e
8
+
9
+ # Colors
10
+ GREEN='\033[0;32m'
11
+ BLUE='\033[0;34m'
12
+ YELLOW='\033[1;33m'
13
+ RED='\033[0;31m'
14
+ NC='\033[0m'
15
+
16
+ BRANCH_NAME=$1
17
+
18
+ # Check if branch name provided
19
+ if [ -z "$BRANCH_NAME" ]; then
20
+ echo -e "${RED}❌ Error: Branch name required${NC}"
21
+ echo "Usage: ./scripts/cleanup-worktree.sh <branch-name>"
22
+ echo ""
23
+ echo "Active worktrees:"
24
+ git worktree list
25
+ exit 1
26
+ fi
27
+
28
+ # Find worktree path
29
+ WORKTREE_PATH=$(git worktree list | grep "$BRANCH_NAME" | awk '{print $1}')
30
+
31
+ if [ -z "$WORKTREE_PATH" ]; then
32
+ echo -e "${RED}❌ Error: Worktree not found for branch: $BRANCH_NAME${NC}"
33
+ echo ""
34
+ echo "Active worktrees:"
35
+ git worktree list
36
+ exit 1
37
+ fi
38
+
39
+ echo -e "${BLUE}🧹 Cleaning up worktree for: $BRANCH_NAME${NC}"
40
+ echo -e "${BLUE}Path: $WORKTREE_PATH${NC}"
41
+ echo ""
42
+
43
+ # Check if PR is merged
44
+ PR_STATUS=$(gh pr list --head "$BRANCH_NAME" --state merged --json number,state --jq '.[0].state' 2>/dev/null || echo "")
45
+
46
+ if [ "$PR_STATUS" != "MERGED" ]; then
47
+ echo -e "${YELLOW}⚠️ Warning: PR for this branch is not merged${NC}"
48
+ read -p "Are you sure you want to delete this worktree? (y/n) " -n 1 -r
49
+ echo
50
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
51
+ echo -e "${BLUE}Cancelled.${NC}"
52
+ exit 0
53
+ fi
54
+ fi
55
+
56
+ # Remove worktree
57
+ echo -e "${BLUE}📂 Removing worktree...${NC}"
58
+ git worktree remove "$WORKTREE_PATH" --force
59
+
60
+ # Delete local branch
61
+ echo -e "${BLUE}🌿 Deleting local branch...${NC}"
62
+ git branch -D "$BRANCH_NAME" 2>/dev/null || true
63
+
64
+ # Delete remote branch
65
+ echo -e "${BLUE}☁️ Deleting remote branch...${NC}"
66
+ git push origin --delete "$BRANCH_NAME" 2>/dev/null || true
67
+
68
+ # Update main
69
+ echo -e "${BLUE}📥 Updating main branch...${NC}"
70
+ git checkout main
71
+ git pull origin main
72
+
73
+ echo ""
74
+ echo -e "${GREEN}✅ Cleanup complete!${NC}"
75
+ echo ""
76
+ echo -e "${BLUE}🗂️ Remaining worktrees:${NC}"
77
+ git worktree list
78
+ echo ""
@@ -0,0 +1,50 @@
1
+ #!/bin/bash
2
+
3
+ # List all active worktrees with their status
4
+ # Usage: ./scripts/list-worktrees.sh
5
+
6
+ # Colors
7
+ GREEN='\033[0;32m'
8
+ BLUE='\033[0;34m'
9
+ YELLOW='\033[1;33m'
10
+ NC='\033[0m'
11
+
12
+ echo -e "${BLUE}🗂️ Active Worktrees${NC}"
13
+ echo ""
14
+
15
+ # Get worktree list
16
+ WORKTREES=$(git worktree list --porcelain)
17
+
18
+ # Parse and display
19
+ echo "$WORKTREES" | awk '
20
+ BEGIN {
21
+ path = ""
22
+ branch = ""
23
+ commit = ""
24
+ }
25
+ /^worktree / {
26
+ if (path != "") {
27
+ printf "📁 \033[0;32m%s\033[0m\n", path
28
+ printf " Branch: \033[0;34m%s\033[0m\n", branch
29
+ printf " Commit: %s\n\n", substr(commit, 1, 7)
30
+ }
31
+ path = substr($0, 10)
32
+ }
33
+ /^branch / {
34
+ branch = substr($0, index($0, "refs/heads/") + 11)
35
+ }
36
+ /^HEAD / {
37
+ commit = substr($0, 6)
38
+ }
39
+ END {
40
+ if (path != "") {
41
+ printf "📁 \033[0;32m%s\033[0m\n", path
42
+ printf " Branch: \033[0;34m%s\033[0m\n", branch
43
+ printf " Commit: %s\n\n", substr(commit, 1, 7)
44
+ }
45
+ }'
46
+
47
+ # Count
48
+ WORKTREE_COUNT=$(git worktree list | wc -l | xargs)
49
+ echo -e "${YELLOW}Total: $WORKTREE_COUNT worktree(s)${NC}"
50
+ echo ""
@@ -0,0 +1,156 @@
1
+ #!/bin/bash
2
+
3
+ # Create a new feature worktree from a GitHub issue
4
+ # Usage: ./scripts/new-feature.sh <issue-number>
5
+ # Example: ./scripts/new-feature.sh 4
6
+
7
+ set -e
8
+
9
+ # Colors for output
10
+ RED='\033[0;31m'
11
+ GREEN='\033[0;32m'
12
+ BLUE='\033[0;34m'
13
+ YELLOW='\033[1;33m'
14
+ NC='\033[0m' # No Color
15
+
16
+ # Check if issue number is provided
17
+ if [ -z "$1" ]; then
18
+ echo -e "${RED}❌ Error: Issue number required${NC}"
19
+ echo "Usage: ./scripts/new-feature.sh <issue-number>"
20
+ echo "Example: ./scripts/new-feature.sh 4"
21
+ exit 1
22
+ fi
23
+
24
+ ISSUE_NUMBER=$1
25
+
26
+ # Check if gh CLI is installed
27
+ if ! command -v gh &> /dev/null; then
28
+ echo -e "${RED}❌ GitHub CLI not found. Install from: https://cli.github.com${NC}"
29
+ exit 1
30
+ fi
31
+
32
+ # Clear invalid GITHUB_TOKEN if set
33
+ export GITHUB_TOKEN=""
34
+
35
+ # Check if authenticated
36
+ if ! gh auth status &> /dev/null; then
37
+ echo -e "${RED}❌ Not authenticated with GitHub. Run: unset GITHUB_TOKEN && gh auth login${NC}"
38
+ exit 1
39
+ fi
40
+
41
+ echo -e "${BLUE}📋 Fetching issue #${ISSUE_NUMBER}...${NC}"
42
+
43
+ # Fetch issue details
44
+ ISSUE_ERROR=$(mktemp)
45
+ if ! ISSUE_DATA=$(gh issue view "$ISSUE_NUMBER" --json title,labels,number 2>"$ISSUE_ERROR"); then
46
+ echo -e "${RED}❌ Failed to fetch issue #${ISSUE_NUMBER}${NC}"
47
+ if [ -s "$ISSUE_ERROR" ]; then
48
+ echo -e "${YELLOW} Error: $(cat "$ISSUE_ERROR")${NC}"
49
+ fi
50
+ rm -f "$ISSUE_ERROR"
51
+ exit 1
52
+ fi
53
+ rm -f "$ISSUE_ERROR"
54
+
55
+ # Extract issue title and create branch name
56
+ ISSUE_TITLE=$(echo "$ISSUE_DATA" | jq -r '.title')
57
+ BRANCH_NAME=$(echo "$ISSUE_TITLE" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//' | sed 's/-$//')
58
+ BRANCH_NAME="feature/${ISSUE_NUMBER}-${BRANCH_NAME}"
59
+
60
+ # Truncate branch name if too long (max 50 chars after feature/)
61
+ if [ ${#BRANCH_NAME} -gt 58 ]; then
62
+ BRANCH_NAME=$(echo "$BRANCH_NAME" | cut -c1-58)
63
+ fi
64
+
65
+ # Get the git repo root (works even if run from subdirectory)
66
+ MAIN_REPO_DIR="$(git rev-parse --show-toplevel 2>/dev/null)"
67
+ if [ -z "$MAIN_REPO_DIR" ]; then
68
+ echo -e "${RED}❌ Not in a git repository${NC}"
69
+ exit 1
70
+ fi
71
+
72
+ # Change to repo root for consistent behavior
73
+ cd "$MAIN_REPO_DIR"
74
+
75
+ # Worktree directory
76
+ WORKTREE_DIR="../worktrees/${BRANCH_NAME}"
77
+
78
+ echo -e "${GREEN}✨ Creating worktree for issue #${ISSUE_NUMBER}${NC}"
79
+ echo -e "${BLUE}Branch: ${BRANCH_NAME}${NC}"
80
+ echo -e "${BLUE}Worktree: ${WORKTREE_DIR}${NC}"
81
+ echo ""
82
+
83
+ # Check for uncommitted changes before switching branches
84
+ if ! git diff-index --quiet HEAD -- 2>/dev/null; then
85
+ echo -e "${RED}❌ Working tree has uncommitted changes${NC}"
86
+ echo -e "${YELLOW} Commit or stash your changes first:${NC}"
87
+ echo -e " git stash push -m 'WIP before issue #${ISSUE_NUMBER}'"
88
+ exit 1
89
+ fi
90
+
91
+ # Check if branch already exists
92
+ if git show-ref --verify --quiet "refs/heads/${BRANCH_NAME}"; then
93
+ echo -e "${YELLOW}⚠️ Branch ${BRANCH_NAME} already exists${NC}"
94
+
95
+ # Check if worktree exists too
96
+ EXISTING_WORKTREE=$(git worktree list | grep "${BRANCH_NAME}" | awk '{print $1}')
97
+ if [ -n "$EXISTING_WORKTREE" ]; then
98
+ echo -e "${GREEN}✅ Worktree already exists at: ${EXISTING_WORKTREE}${NC}"
99
+ echo -e "${BLUE} cd ${EXISTING_WORKTREE}${NC}"
100
+ exit 0
101
+ else
102
+ echo -e "${RED}❌ Branch exists but no worktree found${NC}"
103
+ echo -e "${YELLOW} To create worktree from existing branch:${NC}"
104
+ echo -e " git worktree add ../worktrees/${BRANCH_NAME} ${BRANCH_NAME}"
105
+ echo -e "${YELLOW} Or delete the branch first:${NC}"
106
+ echo -e " git branch -D ${BRANCH_NAME}"
107
+ exit 1
108
+ fi
109
+ fi
110
+
111
+ # Update main branch
112
+ echo -e "${BLUE}📥 Updating main branch...${NC}"
113
+ git fetch origin main
114
+ git checkout main
115
+ git pull origin main
116
+
117
+ # Create worktree
118
+ echo -e "${BLUE}🌿 Creating new worktree...${NC}"
119
+ git worktree add "$WORKTREE_DIR" -b "$BRANCH_NAME"
120
+
121
+ # Navigate to worktree
122
+ cd "$WORKTREE_DIR"
123
+
124
+ # Copy .env.local if it exists (use absolute path from main repo)
125
+ if [ -f "${MAIN_REPO_DIR}/.env.local" ]; then
126
+ echo -e "${BLUE}📋 Copying .env.local...${NC}"
127
+ cp "${MAIN_REPO_DIR}/.env.local" .env.local
128
+ fi
129
+
130
+ # Copy .claude/settings.local.json for auto-approved permissions
131
+ if [ -f "${MAIN_REPO_DIR}/.claude/settings.local.json" ]; then
132
+ echo -e "${BLUE}📋 Copying .claude/settings.local.json...${NC}"
133
+ mkdir -p .claude
134
+ cp "${MAIN_REPO_DIR}/.claude/settings.local.json" .claude/settings.local.json
135
+ fi
136
+
137
+ # Install dependencies if needed
138
+ if [ ! -d "node_modules" ]; then
139
+ echo -e "${BLUE}📦 Installing dependencies...${NC}"
140
+ npm install --silent
141
+ fi
142
+
143
+ echo ""
144
+ echo -e "${GREEN}✅ Worktree created successfully!${NC}"
145
+ echo ""
146
+ echo -e "${YELLOW}📍 Next steps:${NC}"
147
+ echo -e " 1. cd ${WORKTREE_DIR}"
148
+ echo -e " 2. npm run dev"
149
+ echo -e " 3. Work on issue #${ISSUE_NUMBER}: ${ISSUE_TITLE}"
150
+ echo -e " 4. git add . && git commit -m \"Your message\""
151
+ echo -e " 5. git push -u origin ${BRANCH_NAME}"
152
+ echo -e " 6. ./scripts/create-pr.sh ${ISSUE_NUMBER}"
153
+ echo ""
154
+ echo -e "${BLUE}🗂️ Active worktrees:${NC}"
155
+ git worktree list
156
+ echo ""
@@ -0,0 +1,26 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "*",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/pre-tool.sh"
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "PostToolUse": [
15
+ {
16
+ "matcher": "*",
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/post-tool.sh"
21
+ }
22
+ ]
23
+ }
24
+ ]
25
+ }
26
+ }