glori-builder 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 (45) hide show
  1. package/.claude/CLAUDE.md +66 -0
  2. package/.claude/agents/architect.md +69 -0
  3. package/.claude/agents/database-architect.md +36 -0
  4. package/.claude/agents/designer.md +33 -0
  5. package/.claude/agents/developer.md +34 -0
  6. package/.claude/agents/git-workflow.md +60 -0
  7. package/.claude/agents/nextjs-migrator.md +28 -0
  8. package/.claude/agents/product-manager.md +44 -0
  9. package/.claude/agents/qa.md +44 -0
  10. package/.claude/agents/reviewer.md +55 -0
  11. package/.claude/agents/security-reviewer.md +34 -0
  12. package/.claude/agents/test-writer.md +26 -0
  13. package/.claude/commands/auto-pilot.md +228 -0
  14. package/.claude/commands/commit.md +7 -0
  15. package/.claude/commands/create-rules.md +356 -0
  16. package/.claude/commands/deploy-setup.md +158 -0
  17. package/.claude/commands/execute.md +101 -0
  18. package/.claude/commands/issue-prd.md +108 -0
  19. package/.claude/commands/issue-rework.md +272 -0
  20. package/.claude/commands/plan-feature.md +433 -0
  21. package/.claude/commands/plan-project.md +452 -0
  22. package/.claude/commands/prime.md +100 -0
  23. package/.claude/commands/project-setup.md +187 -0
  24. package/.claude/commands/quetrex-docs.md +188 -0
  25. package/.claude/commands/quetrex-setup.md +159 -0
  26. package/.claude/commands/quetrex-update.md +59 -0
  27. package/.claude/commands/secrets.md +122 -0
  28. package/.claude/commands/update-rules.md +143 -0
  29. package/.claude/hooks/auto-format.sh +27 -0
  30. package/.claude/hooks/check-quetrex-update.sh +34 -0
  31. package/.claude/hooks/enforce-branch.sh +66 -0
  32. package/.claude/hooks/security-check.sh +39 -0
  33. package/.claude/settings.json +89 -0
  34. package/.claude/skills/agent-browser/SKILL.md +251 -0
  35. package/.claude/skills/domain-capture/SKILL.md +385 -0
  36. package/.claude/skills/e2e-test/SKILL.md +213 -0
  37. package/.claude/skills/merge-issue/SKILL.md +126 -0
  38. package/.claude/skills/qa-verify/SKILL.md +194 -0
  39. package/.claude/skills/story-builder/SKILL.md +231 -0
  40. package/.claude/skills/tab-control/SKILL.md +92 -0
  41. package/.claude/statusline-command.sh +159 -0
  42. package/.claude/team-protocol.md +28 -0
  43. package/README.md +86 -0
  44. package/install.js +102 -0
  45. package/package.json +34 -0
@@ -0,0 +1,158 @@
1
+ ---
2
+ description: Set up deployment for this project — interviews about platform and environments, then generates a project-level /deploy skill tailored to this project.
3
+ ---
4
+
5
+ # Deploy Setup
6
+
7
+ Generates a project-specific `.claude/skills/deploy/SKILL.md` by interviewing you about your deployment setup. Run once per project. After this, /deploy works for this specific project.
8
+
9
+ ## Interview
10
+
11
+ Ask these questions one at a time, wait for each answer:
12
+
13
+ **Q1 — Platform:**
14
+ "What platform are you deploying to? (Fly.io, Vercel, Railway, Render, AWS, DigitalOcean, VPS, other?)"
15
+
16
+ **Q2 — Environments:**
17
+ "What environments do you have? For example: staging at app-staging.fly.dev and production at app.fly.dev. What are the exact names/URLs?"
18
+
19
+ **Q3 — Rollback:**
20
+ "How do you roll back a bad deploy? (e.g., Fly.io machine rollback, Vercel instant rollback, git tag + redeploy, manual)"
21
+
22
+ **Q4 — Pre-deploy checks:**
23
+ "Are there any steps that must run before deploying? (database migrations, smoke tests, build verification, etc.)"
24
+
25
+ **Q5 — Deploy command:**
26
+ "What's the exact command to deploy? If you're not sure, I'll generate a best-guess based on your platform."
27
+
28
+ ## Platform Auth Reference
29
+
30
+ Use this to generate the correct auth prerequisite for the deploy skill.
31
+
32
+ Each platform falls into one of two categories:
33
+
34
+ **CLI-authenticated** — developer logs in once, token stored by the CLI tool:
35
+
36
+ | Platform | Auth check | Auth command if missing |
37
+ |---|---|---|
38
+ | Fly.io | `fly auth whoami` | `fly auth login` |
39
+ | Vercel | `vercel whoami` | `vercel login` |
40
+ | Railway | `railway whoami` | `railway login` |
41
+ | DigitalOcean | `doctl auth list` | `doctl auth init` |
42
+ | AWS | `aws sts get-caller-identity` | `aws configure` |
43
+
44
+ **API token required** — no CLI auth flow, token goes in secrets.env:
45
+
46
+ | Platform | Token var | Where to get it |
47
+ |---|---|---|
48
+ | Render | `RENDER_API_TOKEN` | Render dashboard → Account → API Keys |
49
+ | Netlify | `NETLIFY_AUTH_TOKEN` | Netlify → User settings → Personal access tokens |
50
+
51
+ For API token platforms: check that the token is set (`echo ${TOKEN_VAR:+set}`) and direct the user to `/secrets add TOKEN_VAR` if missing.
52
+
53
+ ## Generate Deploy Skill
54
+
55
+ Based on all answers, create `.claude/skills/deploy/SKILL.md`.
56
+
57
+ The file must include:
58
+
59
+ 1. **Auth prerequisite** — using the platform reference above, the correct check at the very top
60
+ 2. **Environments** — staging and production URLs/app names
61
+ 3. **Pre-deploy checklist** — from Q4
62
+ 4. **Deploy commands** — per environment
63
+ 5. **Production confirmation gate** — explicit "Are you sure?" before touching production
64
+ 6. **Rollback procedure** — from Q3
65
+ 7. **Post-deploy verification** — check URL, confirm key flows work
66
+
67
+ ### Template
68
+
69
+ ```markdown
70
+ ---
71
+ name: deploy
72
+ description: Deploy {project-name} to staging or production. Usage: /deploy staging or /deploy production
73
+ argument-hint: staging | production
74
+ ---
75
+
76
+ # Deploy: {project-name}
77
+
78
+ ## Auth Prerequisite
79
+
80
+ [For CLI-authenticated platforms:]
81
+ ```bash
82
+ {auth-check-command} 2>/dev/null || {
83
+ echo "Not authenticated with {Platform}. Run: {auth-command}"
84
+ exit 1
85
+ }
86
+ ```
87
+
88
+ [For API token platforms:]
89
+ ```bash
90
+ [ -n "${TOKEN_VAR}" ] || {
91
+ echo "{TOKEN_VAR} is not set. Run: /secrets add {TOKEN_VAR}"
92
+ exit 1
93
+ }
94
+ ```
95
+
96
+ ## Environments
97
+ - Staging: {staging URL or app name}
98
+ - Production: {production URL or app name}
99
+
100
+ ## Pre-Deploy Checklist
101
+ [Each item from Q4 as a bash check or manual confirmation]
102
+
103
+ ## Deploy
104
+
105
+ ### Staging
106
+ ```bash
107
+ [exact staging deploy command(s)]
108
+ ```
109
+
110
+ Verify: [what to check after staging deploy]
111
+
112
+ ### Production
113
+
114
+ > "Deploying to PRODUCTION. This affects live users. Confirm?"
115
+
116
+ Wait for explicit confirmation before running:
117
+
118
+ ```bash
119
+ [exact production deploy command(s)]
120
+ ```
121
+
122
+ ## Rollback
123
+ ```bash
124
+ [exact rollback command(s) from Q3]
125
+ ```
126
+
127
+ ## Post-Deploy Verification
128
+ - [ ] {staging/production URL} loads without errors
129
+ - [ ] [key user flow works]
130
+ - [ ] Check logs: [log command for this platform]
131
+ ```
132
+
133
+ ## Also: add .envrc if direnv is available
134
+
135
+ After writing the deploy skill, check if direnv is installed:
136
+
137
+ ```bash
138
+ which direnv 2>/dev/null && echo "installed" || echo "missing"
139
+ ```
140
+
141
+ If installed and `.envrc` doesn't exist in the project:
142
+
143
+ ```bash
144
+ [ -f .envrc ] || echo 'dotenv' > .envrc && direnv allow .
145
+ ```
146
+
147
+ This makes project `.env` vars (database URLs, API tokens, etc.) automatically available to all commands — including deploy — without manual sourcing.
148
+
149
+ ## Commit
150
+
151
+ ```bash
152
+ mkdir -p .claude/skills/deploy
153
+ git add .claude/skills/deploy/SKILL.md
154
+ [ -f .envrc ] && git add .envrc
155
+ git commit -m "chore(deploy): add project-specific deploy skill for {platform}"
156
+ ```
157
+
158
+ Report: "Deploy skill created for {platform}. Auth check, environments, rollback, and verification all included. Use /deploy staging or /deploy production from now on."
@@ -0,0 +1,101 @@
1
+ ---
2
+ description: Execute an implementation plan
3
+ argument-hint: [path-to-plan]
4
+ ---
5
+
6
+ # Execute: Implement from Plan
7
+
8
+ ## Plan to Execute
9
+
10
+ Read plan file: `$ARGUMENTS`
11
+
12
+ ## Execution Instructions
13
+
14
+ ### 1. Read and Understand
15
+
16
+ - Read the ENTIRE plan carefully
17
+ - Understand all tasks and their dependencies
18
+ - Note the validation commands to run
19
+ - Review the testing strategy
20
+
21
+ ### 2. Execute Tasks in Order
22
+
23
+ For EACH task in "Step by Step Tasks":
24
+
25
+ #### a. Navigate to the task
26
+ - Identify the file and action required
27
+ - Read existing related files if modifying
28
+
29
+ #### b. Implement the task
30
+ - Follow the detailed specifications exactly
31
+ - Maintain consistency with existing code patterns
32
+ - Include proper type hints and documentation
33
+ - Add structured logging where appropriate
34
+
35
+ #### c. Verify as you go
36
+ - After each file change, check syntax
37
+ - Ensure imports are correct
38
+ - Verify types are properly defined
39
+
40
+ ### 3. Implement Testing Strategy
41
+
42
+ After completing implementation tasks:
43
+
44
+ - Create all test files specified in the plan
45
+ - Implement all test cases mentioned
46
+ - Follow the testing approach outlined
47
+ - Ensure tests cover edge cases
48
+
49
+ ### 4. Run Validation Commands
50
+
51
+ Execute ALL validation commands from the plan in order:
52
+
53
+ ```bash
54
+ # Run each command exactly as specified in plan
55
+ ```
56
+
57
+ If any command fails:
58
+ - Fix the issue
59
+ - Re-run the command
60
+ - Continue only when it passes
61
+
62
+ ### 5. Final Verification
63
+
64
+ Before completing:
65
+
66
+ - ✅ All tasks from plan completed
67
+ - ✅ All tests created and passing
68
+ - ✅ All validation commands pass
69
+ - ✅ Code follows project conventions
70
+ - ✅ Documentation added/updated as needed
71
+
72
+ ## Output Report
73
+
74
+ Provide summary:
75
+
76
+ ### Completed Tasks
77
+ - List of all tasks completed
78
+ - Files created (with paths)
79
+ - Files modified (with paths)
80
+
81
+ ### Tests Added
82
+ - Test files created
83
+ - Test cases implemented
84
+ - Test results
85
+
86
+ ### Validation Results
87
+ ```bash
88
+ # Output from each validation command
89
+ ```
90
+
91
+ ### Ready for Commit
92
+ - Confirm all changes are complete
93
+ - Confirm all validations pass
94
+ - Ready for `/commit` command
95
+
96
+ ## Notes
97
+
98
+ - If you encounter issues not addressed in the plan, document them
99
+ - If you need to deviate from the plan, explain why
100
+ - If tests fail, fix implementation until they pass
101
+ - Don't skip validation steps
@@ -0,0 +1,108 @@
1
+ ---
2
+ description: Fetch a Linear issue, evaluate it, and kick off the implementation pipeline
3
+ argument-hint: <ISSUE-ID e.g. QUE-40>
4
+ ---
5
+
6
+ # Issue PRD: Pipeline Intake
7
+
8
+ ## Issue: $ARGUMENTS
9
+
10
+ ### Session Rename
11
+ /rename $ARGUMENTS-{M}-{D}
12
+
13
+ ### Step 1: Fetch the Issue
14
+
15
+ Linear's top-level `issues` query and `issueVcSearch` are unreliable with personal API keys. Always use team-scoped queries.
16
+
17
+ Parse the team key and issue number from `$ARGUMENTS` (e.g., "QUE-40" → team key "QUE", number 40).
18
+
19
+ If $LINEAR_API_KEY is not set, stop and tell the user: "Set the LINEAR_API_KEY environment variable to your Linear API token and try again."
20
+
21
+ **Step 1a** — Get the team ID:
22
+
23
+ ```bash
24
+ curl -s -X POST https://api.linear.app/graphql \
25
+ -H "Authorization: $LINEAR_API_KEY" \
26
+ -H "Content-Type: application/json" \
27
+ -d '{"query": "{ teams(filter: { key: { eq: \"TEAM_KEY\" } }) { nodes { id key name } } }"}'
28
+ ```
29
+
30
+ Replace `TEAM_KEY` with the parsed team key (e.g., "QUE").
31
+
32
+ **Step 1b** — Fetch the issue using the team ID:
33
+
34
+ ```bash
35
+ curl -s -X POST https://api.linear.app/graphql \
36
+ -H "Authorization: $LINEAR_API_KEY" \
37
+ -H "Content-Type: application/json" \
38
+ -d '{"query": "{ team(id: \"TEAM_UUID\") { issues(filter: { number: { eq: ISSUE_NUMBER } }) { nodes { id identifier title description priority state { name } labels { nodes { name } } project { name } } } }"}'
39
+ ```
40
+
41
+ Replace `TEAM_UUID` with the id from Step 1a and `ISSUE_NUMBER` with the parsed number (e.g., 40).
42
+
43
+ Display clearly:
44
+ - **ID**: {identifier}
45
+ - **Title**: {title}
46
+ - **State**: {state.name}
47
+ - **Priority**: {priority}
48
+ - **Labels**: {labels}
49
+ - **Project**: {project.name}
50
+ - **Description**:
51
+ {description}
52
+
53
+ If the issue state is "In Progress" or "Done", warn the user: "This issue is already {state.name}. Stopping to avoid duplicate work." Then stop.
54
+
55
+ ### Step 2: Evaluate and Clarify
56
+
57
+ Read the issue carefully. Ask yourself: could an architect start work on this without asking follow-up questions?
58
+
59
+ The architect needs to know:
60
+ - What to build (goal is clear)
61
+ - What's in scope and out of scope
62
+ - Any technical constraints or decisions only the user can make
63
+
64
+ If the issue is clear — ask NOTHING. Proceed to Step 3.
65
+
66
+ If there are genuine gaps — ask ONLY about those specific gaps. One or two sharp questions. Not a template. Not a checklist. If the issue says "add dark mode" with no other context, ask what components need it and whether there's a design system to follow. If the issue says "fix the auth bug where users get logged out after 5 minutes" that is clear enough — ask nothing.
67
+
68
+ Wait for answers before proceeding.
69
+
70
+ ### Step 3: Branch Setup
71
+
72
+ Create the feature branch:
73
+
74
+ ```bash
75
+ git checkout main
76
+ git pull origin main
77
+ git checkout -b feature/$ARGUMENTS-$(echo "{title}" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | cut -c1-50)
78
+ git branch --show-current
79
+ ```
80
+
81
+ Confirm you are on the feature branch before continuing.
82
+
83
+ ### Step 4: Comment on Linear Issue
84
+
85
+ Add a comment to the Linear issue to mark it as in progress:
86
+
87
+ ```bash
88
+ curl -s -X POST https://api.linear.app/graphql \
89
+ -H "Authorization: $LINEAR_API_KEY" \
90
+ -H "Content-Type: application/json" \
91
+ -d '{"query": "mutation { commentCreate(input: { issueId: \"ISSUE_UUID\", body: \"Pipeline started — architect building implementation plan.\" }) { success } }"}'
92
+ ```
93
+
94
+ Replace `ISSUE_UUID` with the `id` field (UUID) from the Step 1b response.
95
+
96
+ ### Step 5: Hand Off
97
+
98
+ Tell the orchestrator:
99
+
100
+ > "Issue $ARGUMENTS is ready. Branch: {branch-name}. Starting pipeline: architect → developer(s) → QA → reviewer → git-workflow."
101
+
102
+ Then invoke the architect agent to create the implementation plan for this issue, passing it the issue title, description, and any clarifications from Step 2.
103
+
104
+ ## Notes
105
+ - LINEAR_API_KEY must be set as an environment variable
106
+ - The architect creates the implementation PRD — this skill does not
107
+ - If the issue is already In Progress or Done, warn the user and stop
108
+ - Never set the issue to "Queued" — that was the old runner pattern
@@ -0,0 +1,272 @@
1
+ ---
2
+ description: Create a rework document from tester feedback on a previously completed issue
3
+ argument-hint: <ISSUE-ID e.g. SMA-62>
4
+ ---
5
+
6
+ # Rework Issue from Tester Feedback
7
+
8
+ ## Issue to Rework
9
+
10
+ Rework the Linear issue: `$ARGUMENTS`
11
+
12
+ ### Rename Session
13
+
14
+ Before doing anything else, rename this Claude Code session:
15
+
16
+ ```
17
+ /rename rework-$ARGUMENTS-{M}-{D}
18
+ ```
19
+
20
+ For example, if the issue is SMA-62 and today is March 16: `/rename rework-SMA-62-3-16`
21
+
22
+ ### Step 0: Branch Setup (MANDATORY — DO THIS FIRST)
23
+
24
+ **CRITICAL: You MUST create a feature branch before doing ANY other work. The project enforces feature branches — committing or pushing on `main` will be BLOCKED by hooks, wasting API calls. Do NOT skip this step.**
25
+
26
+ 1. If not already on `main`, switch to it:
27
+
28
+ ```bash
29
+ git checkout main
30
+ ```
31
+
32
+ 2. Pull the latest changes:
33
+
34
+ ```bash
35
+ git pull origin main
36
+ ```
37
+
38
+ 3. Create a feature branch for the rework doc:
39
+
40
+ ```bash
41
+ git checkout -b docs/rework-$ARGUMENTS
42
+ ```
43
+
44
+ 4. Verify you are on the new branch (NOT `main`):
45
+
46
+ ```bash
47
+ git branch --show-current
48
+ ```
49
+
50
+ The output MUST show `docs/rework-$ARGUMENTS`. Do NOT proceed until confirmed.
51
+
52
+ If `git checkout main` fails because of uncommitted changes on another branch, run `git stash` first, then `git checkout main`. Do NOT force-checkout or discard work.
53
+
54
+ ### Step 1: Fetch the Issue + Tester Comments
55
+
56
+ Linear's top-level `issues` query and `issueVcSearch` are unreliable with personal API keys. Always use team-scoped queries.
57
+
58
+ Parse the team key and issue number from `$ARGUMENTS` (e.g., "SMA-62" -> team key "SMA", number 62).
59
+
60
+ **Step 1a** — Get the team ID:
61
+
62
+ ```bash
63
+ curl -s -X POST https://api.linear.app/graphql \
64
+ -H "Authorization: $LINEAR_API_KEY" \
65
+ -H "Content-Type: application/json" \
66
+ -d '{"query": "{ teams(filter: { key: { eq: \"TEAM_KEY\" } }) { nodes { id key name } } }"}'
67
+ ```
68
+
69
+ Replace `TEAM_KEY` with the parsed team key (e.g., "SMA").
70
+
71
+ **Step 1b** — Fetch the issue with ALL comments:
72
+
73
+ ```bash
74
+ curl -s -X POST https://api.linear.app/graphql \
75
+ -H "Authorization: $LINEAR_API_KEY" \
76
+ -H "Content-Type: application/json" \
77
+ -d '{"query": "{ team(id: \"TEAM_UUID\") { issues(filter: { number: { eq: ISSUE_NUMBER } }) { nodes { id identifier title description priority estimate state { name } labels { nodes { name } } project { name } team { name key } comments { nodes { body createdAt user { name } } } } } }"}'
78
+ ```
79
+
80
+ Display the issue summary:
81
+ - **ID**: {identifier}
82
+ - **Title**: {title}
83
+ - **State**: {state.name} (should be "Human: Changes Needed")
84
+ - **Labels**: {labels}
85
+
86
+ **Step 1c** — Extract tester feedback:
87
+
88
+ From the comments, identify the **tester's feedback comments** — these are comments that came AFTER any "PRD ready" or CI-related system comments, from non-system users (not "Glen Barnhardt" system comments about CI or PRD). Display them clearly:
89
+
90
+ > **Tester Feedback:**
91
+ > {each tester comment with date and author}
92
+
93
+ If there are no tester comments, STOP and tell the user: "No tester feedback found on $ARGUMENTS. Is the feedback in a different location?"
94
+
95
+ If $LINEAR_API_KEY is not set, stop and tell the user: "Set the LINEAR_API_KEY environment variable to your Linear API token and try again."
96
+
97
+ ### Step 2: Load Context
98
+
99
+ Read the following to understand what was already built:
100
+
101
+ 1. **Original PRD** — `.claude/prds/$ARGUMENTS.md` (if it exists)
102
+ 2. **CLAUDE.md** — project root, for architecture context
103
+ 3. **Git history** — find commits and PRs related to this issue:
104
+
105
+ ```bash
106
+ git log --oneline --all --grep="$ARGUMENTS" | head -20
107
+ ```
108
+
109
+ Also check for merged PRs:
110
+
111
+ ```bash
112
+ gh pr list --state merged --search "$ARGUMENTS" --json number,title,mergedAt --limit 5
113
+ ```
114
+
115
+ This tells the rework agent what code already exists on main.
116
+
117
+ ### Step 3: Quick Dialog
118
+
119
+ This is NOT the full 5-question PRD dialog. The tester's comment IS the spec. Ask only what's needed:
120
+
121
+ **Question 1 — Scope Confirmation:**
122
+ Present a summary to the user:
123
+
124
+ > Based on tester feedback, here's what needs to change:
125
+ > {bullet list of each issue from tester comments}
126
+ >
127
+ > The original PRD specified: {relevant section from original PRD}
128
+ >
129
+ > Is this the complete scope, or is there additional context?
130
+
131
+ **Question 2 (only if needed) — Ambiguity:**
132
+ If any tester comment is unclear or could be interpreted multiple ways, ask ONE targeted follow-up. Otherwise, skip this.
133
+
134
+ Do NOT ask about architecture, testing philosophy, or acceptance criteria — derive those from the original PRD and codebase patterns.
135
+
136
+ ### Step 4: Generate Rework Document
137
+
138
+ Determine the rework filename:
139
+ - If `.claude/prds/$ARGUMENTS-rework.md` does NOT exist: use `$ARGUMENTS-rework.md`
140
+ - If it exists, find the highest existing number and increment: `$ARGUMENTS-rework-2.md`, `$ARGUMENTS-rework-3.md`, etc.
141
+
142
+ Create the rework document at `.claude/prds/{filename}`:
143
+
144
+ ```markdown
145
+ # $ARGUMENTS Rework: {Title}
146
+
147
+ ## Tester Feedback
148
+
149
+ {Verbatim tester comments with dates — this is the source of truth for what to fix}
150
+
151
+ ## What Was Already Implemented
152
+
153
+ - PR #{number}: {title} (merged {date})
154
+ - Key files modified: {list from PR}
155
+
156
+ ## What Needs to Change
157
+
158
+ {For each piece of tester feedback, specify:}
159
+
160
+ ### {Feedback item 1 summary}
161
+
162
+ **Problem**: {what the tester reported}
163
+ **Root cause**: {your analysis of why this happened — reference specific files/lines if possible}
164
+ **Fix**: {what needs to change, with specific file paths}
165
+
166
+ ### {Feedback item 2 summary}
167
+
168
+ {same structure}
169
+
170
+ ## Files to Modify
171
+
172
+ {List each file with its absolute path and what changes are needed}
173
+
174
+ ## Testing Requirements
175
+
176
+ - [ ] {specific test derived from tester feedback — e.g., "Verify audit log menu item appears for admin role"}
177
+ - [ ] {regression test — ensure original functionality still works}
178
+ - [ ] All CI checks pass: type-check, lint, test, build
179
+
180
+ ## Acceptance Criteria
181
+
182
+ - [ ] {directly maps to each piece of tester feedback}
183
+ - [ ] {e.g., "Lead Form Event field saves selected value and persists on form submission"}
184
+ - [ ] No TypeScript errors, no lint warnings
185
+ - [ ] Code follows existing project patterns
186
+ ```
187
+
188
+ ### Step 5: Commit, Push, and Update Linear
189
+
190
+ 1. Stage and commit the rework doc:
191
+
192
+ ```bash
193
+ git add .claude/prds/$ARGUMENTS-rework*.md
194
+ git commit -m "docs: add rework document for $ARGUMENTS"
195
+ ```
196
+
197
+ 2. Push the branch:
198
+
199
+ ```bash
200
+ git push -u origin docs/rework-$ARGUMENTS
201
+ ```
202
+
203
+ 3. Add a comment to the Linear issue:
204
+
205
+ ```bash
206
+ curl -s -X POST https://api.linear.app/graphql \
207
+ -H "Authorization: $LINEAR_API_KEY" \
208
+ -H "Content-Type: application/json" \
209
+ -d '{"query": "mutation { commentCreate(input: { issueId: \"ISSUE_UUID\", body: \"Rework document ready: .claude/prds/{REWORK_FILENAME}\" }) { success } }"}'
210
+ ```
211
+
212
+ Replace `ISSUE_UUID` with the UUID from Step 1, and `{REWORK_FILENAME}` with the actual filename used.
213
+
214
+ ### Step 6: Set Linear Status to Todo
215
+
216
+ Get the "Todo" state ID:
217
+
218
+ ```bash
219
+ curl -s -X POST https://api.linear.app/graphql \
220
+ -H "Authorization: $LINEAR_API_KEY" \
221
+ -H "Content-Type: application/json" \
222
+ -d '{"query": "{ team(id: \"TEAM_UUID\") { states(filter: { name: { eq: \"Todo\" } }) { nodes { id name } } } }"}'
223
+ ```
224
+
225
+ Update the issue status:
226
+
227
+ ```bash
228
+ curl -s -X POST https://api.linear.app/graphql \
229
+ -H "Authorization: $LINEAR_API_KEY" \
230
+ -H "Content-Type: application/json" \
231
+ -d '{"query": "mutation { issueUpdate(id: \"ISSUE_UUID\", input: { stateId: \"TODO_STATE_ID\" }) { success issue { id state { name } } } }"}'
232
+ ```
233
+
234
+ ### Step 7: Cleanup (MANDATORY — DO THIS LAST)
235
+
236
+ 1. Switch back to `main`:
237
+
238
+ ```bash
239
+ git checkout main
240
+ ```
241
+
242
+ 2. Delete the local rework doc branch:
243
+
244
+ ```bash
245
+ git branch -D docs/rework-$ARGUMENTS
246
+ ```
247
+
248
+ 3. Verify you are on `main`:
249
+
250
+ ```bash
251
+ git branch --show-current
252
+ ```
253
+
254
+ ## HARD STOP
255
+
256
+ After Step 7 completes and you have verified you are on `main`, say EXACTLY:
257
+
258
+ > "Rework document created for $ARGUMENTS. Run /issue-prd $ARGUMENTS to kick off the implementation pipeline."
259
+
260
+ Then STOP. Do not:
261
+ - Summarize the rework document contents
262
+ - Offer to implement the fix
263
+ - Suggest next steps for this issue
264
+ - Ask if the user wants to proceed with implementation
265
+
266
+ ## Notes
267
+
268
+ - Step 0 and Step 7 are non-negotiable — skipping them wastes API calls and leaves dirty state
269
+ - The dialog in Step 3 should be FAST — the tester's comment is the spec, not a starting point for a new PRD
270
+ - The rework document must be self-contained enough that an agent can implement without asking questions
271
+ - Always reference the original PRD for context but do NOT copy its full content into the rework doc
272
+ - If the issue has been reworked before, reference previous rework docs so the agent knows the history