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.
- package/.claude/CLAUDE.md +66 -0
- package/.claude/agents/architect.md +69 -0
- package/.claude/agents/database-architect.md +36 -0
- package/.claude/agents/designer.md +33 -0
- package/.claude/agents/developer.md +34 -0
- package/.claude/agents/git-workflow.md +60 -0
- package/.claude/agents/nextjs-migrator.md +28 -0
- package/.claude/agents/product-manager.md +44 -0
- package/.claude/agents/qa.md +44 -0
- package/.claude/agents/reviewer.md +55 -0
- package/.claude/agents/security-reviewer.md +34 -0
- package/.claude/agents/test-writer.md +26 -0
- package/.claude/commands/auto-pilot.md +228 -0
- package/.claude/commands/commit.md +7 -0
- package/.claude/commands/create-rules.md +356 -0
- package/.claude/commands/deploy-setup.md +158 -0
- package/.claude/commands/execute.md +101 -0
- package/.claude/commands/issue-prd.md +108 -0
- package/.claude/commands/issue-rework.md +272 -0
- package/.claude/commands/plan-feature.md +433 -0
- package/.claude/commands/plan-project.md +452 -0
- package/.claude/commands/prime.md +100 -0
- package/.claude/commands/project-setup.md +187 -0
- package/.claude/commands/quetrex-docs.md +188 -0
- package/.claude/commands/quetrex-setup.md +159 -0
- package/.claude/commands/quetrex-update.md +59 -0
- package/.claude/commands/secrets.md +122 -0
- package/.claude/commands/update-rules.md +143 -0
- package/.claude/hooks/auto-format.sh +27 -0
- package/.claude/hooks/check-quetrex-update.sh +34 -0
- package/.claude/hooks/enforce-branch.sh +66 -0
- package/.claude/hooks/security-check.sh +39 -0
- package/.claude/settings.json +89 -0
- package/.claude/skills/agent-browser/SKILL.md +251 -0
- package/.claude/skills/domain-capture/SKILL.md +385 -0
- package/.claude/skills/e2e-test/SKILL.md +213 -0
- package/.claude/skills/merge-issue/SKILL.md +126 -0
- package/.claude/skills/qa-verify/SKILL.md +194 -0
- package/.claude/skills/story-builder/SKILL.md +231 -0
- package/.claude/skills/tab-control/SKILL.md +92 -0
- package/.claude/statusline-command.sh +159 -0
- package/.claude/team-protocol.md +28 -0
- package/README.md +86 -0
- package/install.js +102 -0
- package/package.json +34 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Work through all Linear issues in a project autonomously. Runs the full pipeline (architect → developers → QA → reviewer → merge) for each issue in dependency order, auto-merges PRs, and continues until the backlog is empty. Run after /plan-project to walk away and let Glori Builder finish the project.
|
|
3
|
+
argument-hint: <LINEAR-PROJECT-ID>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Auto-Pilot
|
|
7
|
+
|
|
8
|
+
Works through every queued issue in a Linear project — one at a time, in dependency order — until the backlog is empty. Each issue runs the full Glori Builder pipeline and is auto-merged to main when QA and review pass.
|
|
9
|
+
|
|
10
|
+
## Before Starting
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Verify LINEAR_API_KEY is set
|
|
14
|
+
echo "${LINEAR_API_KEY:+set}"
|
|
15
|
+
|
|
16
|
+
# Verify gh is authenticated
|
|
17
|
+
gh auth status 2>&1 | head -1
|
|
18
|
+
|
|
19
|
+
# Verify git is clean and on main
|
|
20
|
+
git branch --show-current
|
|
21
|
+
git status --porcelain
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Stop if any check fails and tell the user what to fix.
|
|
25
|
+
|
|
26
|
+
## Phase 1: Load the Backlog
|
|
27
|
+
|
|
28
|
+
### Step 1a: Get project issues from Linear
|
|
29
|
+
|
|
30
|
+
If `$ARGUMENTS` is provided, use it as the project ID. Otherwise, ask: "Which Linear project should I work? (provide the project ID)"
|
|
31
|
+
|
|
32
|
+
Fetch all unstarted/backlog issues for this project, sorted by `sortOrder`:
|
|
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": "{ issues(filter: { project: { id: { eq: \"PROJECT_ID\" } }, state: { type: { in: [\"unstarted\", \"backlog\"] } } }, orderBy: sortOrder) { nodes { id identifier title sortOrder state { name type } relations { nodes { type relatedIssue { id identifier state { type } } } } } } }"}'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Step 1b: Build execution order
|
|
42
|
+
|
|
43
|
+
From the results, build the dependency graph:
|
|
44
|
+
- An issue is **ready** if all issues it is blocked by are in state `completed`
|
|
45
|
+
- Sort ready issues by `sortOrder` (ascending)
|
|
46
|
+
- Group into execution batches (same batch = no inter-dependency)
|
|
47
|
+
|
|
48
|
+
Display the plan:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
Auto-pilot plan: {N} issues
|
|
52
|
+
|
|
53
|
+
Batch 1 (start immediately):
|
|
54
|
+
{identifier}: {title}
|
|
55
|
+
{identifier}: {title}
|
|
56
|
+
|
|
57
|
+
Batch 2 (after Batch 1):
|
|
58
|
+
{identifier}: {title}
|
|
59
|
+
|
|
60
|
+
...
|
|
61
|
+
|
|
62
|
+
Issues will be worked sequentially within each batch.
|
|
63
|
+
PRs will be auto-merged after QA and review pass.
|
|
64
|
+
Failed issues (3 QA retries exhausted) will be skipped and logged.
|
|
65
|
+
|
|
66
|
+
Proceed?
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Wait for confirmation.
|
|
70
|
+
|
|
71
|
+
### Step 1c: Initialize state file
|
|
72
|
+
|
|
73
|
+
Create `.claude/autopilot-{YYYYMMDD-HHMM}.json`:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"projectId": "PROJECT_ID",
|
|
78
|
+
"startedAt": "ISO_TIMESTAMP",
|
|
79
|
+
"issues": {}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This file tracks progress and allows resuming if the session ends.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Phase 2: Work Each Issue
|
|
88
|
+
|
|
89
|
+
For each issue in execution order (batch by batch, sequential within batch):
|
|
90
|
+
|
|
91
|
+
### Step 2a: Check if already done (resumable)
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
cat .claude/autopilot-*.json 2>/dev/null | python3 -c "
|
|
95
|
+
import json, sys
|
|
96
|
+
d = json.load(sys.stdin)
|
|
97
|
+
print(d['issues'].get('ISSUE_ID', {}).get('status', 'pending'))
|
|
98
|
+
"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
If status is `complete` or `skipped`, skip to next issue.
|
|
102
|
+
|
|
103
|
+
### Step 2b: Mark as in progress
|
|
104
|
+
|
|
105
|
+
Update state file: `"ISSUE_ID": { "status": "in_progress", "retries": 0 }`
|
|
106
|
+
|
|
107
|
+
Update Linear status to In Progress:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
curl -s -X POST https://api.linear.app/graphql \
|
|
111
|
+
-H "Authorization: $LINEAR_API_KEY" \
|
|
112
|
+
-H "Content-Type: application/json" \
|
|
113
|
+
-d '{"query": "mutation { issueUpdate(id: \"ISSUE_UUID\", input: { stateId: \"IN_PROGRESS_STATE_ID\" }) { success } }"}'
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Step 2c: Create the feature branch
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
git checkout main && git pull origin main
|
|
120
|
+
BRANCH="feature/$(echo '{identifier}-{title}' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]/-/g' | cut -c1-60)"
|
|
121
|
+
git checkout -b "$BRANCH"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Step 2d: Run the pipeline
|
|
125
|
+
|
|
126
|
+
Invoke each agent in sequence, passing the issue details:
|
|
127
|
+
|
|
128
|
+
1. **Architect agent** — create implementation plan for this issue
|
|
129
|
+
2. **Designer agent** (if architect flagged `designer_required: true`) — create design spec
|
|
130
|
+
3. **Developer agent(s)** — spawn parallel workers per architect's file ownership map
|
|
131
|
+
4. **Merge sub-branches** — merge each developer's sub-branch into the feature branch
|
|
132
|
+
5. **QA agent** — run verification chain, report exit codes
|
|
133
|
+
|
|
134
|
+
**If QA fails:**
|
|
135
|
+
- Increment retry counter
|
|
136
|
+
- If retries < 3: send exact failure output to developer agent(s), re-run developers and QA
|
|
137
|
+
- If retries == 3: mark issue as `skipped`, add Linear comment explaining failures, continue to next issue
|
|
138
|
+
|
|
139
|
+
6. **Reviewer agent** — semantic review of full diff
|
|
140
|
+
- If reviewer rejects: send feedback to developer, rerun developers → QA → reviewer (counts against retry limit)
|
|
141
|
+
- If reviewer approves: continue
|
|
142
|
+
|
|
143
|
+
### Step 2e: Create and merge the PR
|
|
144
|
+
|
|
145
|
+
**git-workflow agent** — commit, push, create PR.
|
|
146
|
+
|
|
147
|
+
Wait for CI to pass:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
gh pr checks {PR_NUMBER} --watch --timeout 600
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
If CI passes, auto-merge:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
gh pr merge {PR_NUMBER} --squash
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Pull new main:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
git checkout main && git pull origin main
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
If CI fails after 2 minutes: treat as QA failure, increment retry counter.
|
|
166
|
+
|
|
167
|
+
### Step 2f: Update status
|
|
168
|
+
|
|
169
|
+
On **success**:
|
|
170
|
+
- Update Linear issue to Done
|
|
171
|
+
- Update state file: `"status": "complete", "pr": PR_NUMBER`
|
|
172
|
+
- Add Linear comment: "Completed by Glori Builder auto-pilot."
|
|
173
|
+
|
|
174
|
+
On **skip** (3 failures):
|
|
175
|
+
- Update Linear issue to status `in_review` (human needs to look)
|
|
176
|
+
- Update state file: `"status": "skipped", "reason": "3 QA/review cycles exhausted"`
|
|
177
|
+
- Add Linear comment with the failure details
|
|
178
|
+
|
|
179
|
+
### Step 2g: Context check
|
|
180
|
+
|
|
181
|
+
After each issue, check context usage. If above 70%, run `/compact` before starting the next issue. Auto-pilot is fully resumable from the state file — a fresh session can continue with `/auto-pilot --resume`.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Phase 3: Summary
|
|
186
|
+
|
|
187
|
+
When all issues are processed (or none remain in a ready state):
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
Auto-pilot complete.
|
|
191
|
+
|
|
192
|
+
✓ Completed: {N} issues
|
|
193
|
+
{identifier}: {title}
|
|
194
|
+
...
|
|
195
|
+
|
|
196
|
+
⚠ Skipped (needs human review): {N} issues
|
|
197
|
+
{identifier}: {title} — {failure summary}
|
|
198
|
+
|
|
199
|
+
✗ Blocked (dependencies not met): {N} issues
|
|
200
|
+
{identifier}: {title} — waiting on {blocking-identifier}
|
|
201
|
+
|
|
202
|
+
State log: .claude/autopilot-{timestamp}.json
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
For skipped issues: update Linear to `In Review` so they surface for manual attention.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Resuming an Interrupted Run
|
|
210
|
+
|
|
211
|
+
If auto-pilot stops mid-run (context overflow, session end, error):
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
/auto-pilot --resume
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
This reads the most recent `.claude/autopilot-*.json` state file, skips completed issues, and continues from where it left off.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Notes
|
|
222
|
+
|
|
223
|
+
- Issues are worked sequentially — parallel batches in v1 are sequential for reliability
|
|
224
|
+
- Each issue gets a clean branch from the latest main after the previous merge
|
|
225
|
+
- Auto-merge waits for CI to pass — branch protection is enforced
|
|
226
|
+
- State file survives session restarts — auto-pilot is always resumable
|
|
227
|
+
- Skipped issues are not deleted from Linear — they stay visible for human review
|
|
228
|
+
- Run `/auto-pilot PROJECT-ID` at any time to work remaining backlog issues
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Create a new commit for all of our uncommitted changes
|
|
2
|
+
run git status && git diff HEAD && git status --porcelain to see what files are uncommitted
|
|
3
|
+
add the untracked and changed files
|
|
4
|
+
|
|
5
|
+
Add an atomic commit message with an appropriate message
|
|
6
|
+
|
|
7
|
+
add a tag such as "feat", "fix", "docs", etc. that reflects our work
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate the project .claude/CLAUDE.md with stack, verification commands, and conventions. Choose from predefined templates (Next.js, Python, Rust, Rails, iOS, Go, Node.js) and customize. QA and developer agents read this file.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Create Project Rules
|
|
6
|
+
|
|
7
|
+
Generates `.claude/CLAUDE.md` for this project. The QA agent reads the Verification section to know which commands to run. The developer agent reads Conventions for code quality rules.
|
|
8
|
+
|
|
9
|
+
Run once per project, after `/project-setup`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Step 1: Choose Your Stack
|
|
14
|
+
|
|
15
|
+
Present these options:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Which stack best describes this project?
|
|
19
|
+
|
|
20
|
+
1. Next.js — TypeScript, App Router, Vitest, Biome
|
|
21
|
+
2. Python — FastAPI / Django / Flask, pytest, ruff, mypy
|
|
22
|
+
3. Rust — Axum / Actix / bare, cargo test, clippy
|
|
23
|
+
4. Ruby on Rails — Rails 7, RSpec, RuboCop
|
|
24
|
+
5. iOS — Swift, SwiftUI, XCTest, SwiftLint
|
|
25
|
+
6. Go — net/http / Gin / Echo, go test, golangci-lint
|
|
26
|
+
7. Node.js — TypeScript, Express / Fastify, Vitest, Biome
|
|
27
|
+
8. Custom — I'll ask you about your stack
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Wait for the user's choice.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Step 2: Auto-Detect Details
|
|
35
|
+
|
|
36
|
+
Scan existing files to fill in specifics before asking anything:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Node-based projects
|
|
40
|
+
cat package.json 2>/dev/null
|
|
41
|
+
|
|
42
|
+
# Python projects
|
|
43
|
+
cat pyproject.toml 2>/dev/null
|
|
44
|
+
cat requirements.txt 2>/dev/null
|
|
45
|
+
|
|
46
|
+
# Rust
|
|
47
|
+
cat Cargo.toml 2>/dev/null
|
|
48
|
+
|
|
49
|
+
# Ruby
|
|
50
|
+
cat Gemfile 2>/dev/null
|
|
51
|
+
|
|
52
|
+
# Go
|
|
53
|
+
cat go.mod 2>/dev/null
|
|
54
|
+
|
|
55
|
+
# iOS
|
|
56
|
+
ls *.xcodeproj *.xcworkspace 2>/dev/null | head -3
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Report what was detected. Use this to fill in template variables (ORM, framework variant, project name, etc.).
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Step 3: Customize
|
|
64
|
+
|
|
65
|
+
Ask: "Anything to adjust? (ORM, framework variant, test runner, specific conventions, additional tools)"
|
|
66
|
+
|
|
67
|
+
If no adjustments needed, proceed. Apply any changes to the template.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Step 4: Write `.claude/CLAUDE.md`
|
|
72
|
+
|
|
73
|
+
Apply the matching template below. Replace all `{variables}` with detected or provided values.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
### Template: Next.js
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
# Project: {project-name}
|
|
81
|
+
|
|
82
|
+
## Stack
|
|
83
|
+
- Language: TypeScript (strict)
|
|
84
|
+
- Framework: Next.js {version} (App Router, React 19, Turbopack)
|
|
85
|
+
- UI: {ShadCN + Tailwind CSS / other}
|
|
86
|
+
- ORM: {Drizzle / Prisma} + PostgreSQL
|
|
87
|
+
- State: TanStack Query v5 + Zustand
|
|
88
|
+
- Testing: Vitest + React Testing Library
|
|
89
|
+
- Linting: Biome
|
|
90
|
+
|
|
91
|
+
## Verification
|
|
92
|
+
Run in this order — all must pass before any PR:
|
|
93
|
+
1. `npx biome check --write .`
|
|
94
|
+
2. `npm run type-check`
|
|
95
|
+
3. `npm run test`
|
|
96
|
+
4. `npm run build`
|
|
97
|
+
|
|
98
|
+
## Conventions
|
|
99
|
+
- No `any` types — use proper TypeScript throughout
|
|
100
|
+
- No `@ts-ignore` — fix the root cause
|
|
101
|
+
- `snake_case` for database columns, `camelCase` for TypeScript
|
|
102
|
+
- Server components by default — `"use client"` only when required
|
|
103
|
+
- API routes in `app/api/`, server actions in `app/actions/`
|
|
104
|
+
- Components in `components/`, hooks in `hooks/`, utilities in `lib/`
|
|
105
|
+
|
|
106
|
+
## Key Commands
|
|
107
|
+
- Dev server: `npm run dev`
|
|
108
|
+
- DB push: `npx drizzle-kit push` / `npx prisma db push`
|
|
109
|
+
- DB studio: `npx drizzle-kit studio` / `npx prisma studio`
|
|
110
|
+
- Install: `npm install`
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
### Template: Python
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
# Project: {project-name}
|
|
119
|
+
|
|
120
|
+
## Stack
|
|
121
|
+
- Language: Python {version}
|
|
122
|
+
- Framework: {FastAPI / Django / Flask}
|
|
123
|
+
- ORM: {SQLAlchemy / Django ORM / Tortoise / SQLModel}
|
|
124
|
+
- Testing: pytest{+ pytest-asyncio if async}
|
|
125
|
+
- Linting: ruff + mypy
|
|
126
|
+
- Package manager: {uv / pip / poetry}
|
|
127
|
+
|
|
128
|
+
## Verification
|
|
129
|
+
Run in this order — all must pass before any PR:
|
|
130
|
+
1. `ruff check --fix .`
|
|
131
|
+
2. `mypy .`
|
|
132
|
+
3. `pytest`
|
|
133
|
+
|
|
134
|
+
## Conventions
|
|
135
|
+
- Type hints on all functions and return values — no untyped code
|
|
136
|
+
- Pydantic models for all request/response schemas
|
|
137
|
+
- `snake_case` everywhere
|
|
138
|
+
- Tests mirror the module structure in `tests/`
|
|
139
|
+
- Raise specific exceptions, not bare `Exception`
|
|
140
|
+
|
|
141
|
+
## Key Commands
|
|
142
|
+
- Dev server: `{uvicorn main:app --reload / python manage.py runserver}`
|
|
143
|
+
- Install: `{uv sync / pip install -r requirements.txt}`
|
|
144
|
+
- DB migrate: `{alembic upgrade head / python manage.py migrate}`
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### Template: Rust
|
|
150
|
+
|
|
151
|
+
```markdown
|
|
152
|
+
# Project: {project-name}
|
|
153
|
+
|
|
154
|
+
## Stack
|
|
155
|
+
- Language: Rust ({edition} edition)
|
|
156
|
+
- Framework: {Axum / Actix-web / bare}
|
|
157
|
+
- Testing: cargo test
|
|
158
|
+
- Linting: clippy + rustfmt
|
|
159
|
+
- DB: {sqlx / Diesel / SeaORM / none}
|
|
160
|
+
|
|
161
|
+
## Verification
|
|
162
|
+
Run in this order — all must pass before any PR:
|
|
163
|
+
1. `cargo fmt --check`
|
|
164
|
+
2. `cargo clippy -- -D warnings`
|
|
165
|
+
3. `cargo test`
|
|
166
|
+
4. `cargo build --release`
|
|
167
|
+
|
|
168
|
+
## Conventions
|
|
169
|
+
- No `unwrap()` or `expect()` in production paths — use `?` or handle errors explicitly
|
|
170
|
+
- All public items documented with `///`
|
|
171
|
+
- `snake_case` for functions/variables, `PascalCase` for types/traits/enums
|
|
172
|
+
- Prefer `impl Trait` in function signatures over generics where possible
|
|
173
|
+
- Error types implement `std::error::Error`
|
|
174
|
+
|
|
175
|
+
## Key Commands
|
|
176
|
+
- Run: `cargo run`
|
|
177
|
+
- Check (fast): `cargo check`
|
|
178
|
+
- Watch: `cargo watch -x run`
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### Template: Ruby on Rails
|
|
184
|
+
|
|
185
|
+
```markdown
|
|
186
|
+
# Project: {project-name}
|
|
187
|
+
|
|
188
|
+
## Stack
|
|
189
|
+
- Language: Ruby {version}
|
|
190
|
+
- Framework: Rails {version}
|
|
191
|
+
- Testing: RSpec + FactoryBot + Capybara
|
|
192
|
+
- Linting: RuboCop + StandardRB
|
|
193
|
+
- DB: PostgreSQL + Active Record
|
|
194
|
+
|
|
195
|
+
## Verification
|
|
196
|
+
Run in this order — all must pass before any PR:
|
|
197
|
+
1. `bundle exec rubocop --autocorrect`
|
|
198
|
+
2. `bundle exec rspec`
|
|
199
|
+
|
|
200
|
+
## Conventions
|
|
201
|
+
- Follow Rails conventions — convention over configuration
|
|
202
|
+
- Thin controllers, fat models (service objects for complex logic)
|
|
203
|
+
- `snake_case` for Ruby, Rails naming for files and classes
|
|
204
|
+
- Use concerns for shared behaviour across models/controllers
|
|
205
|
+
- Prefer scopes over class methods for queries
|
|
206
|
+
|
|
207
|
+
## Key Commands
|
|
208
|
+
- Dev: `bin/rails server`
|
|
209
|
+
- Console: `bin/rails console`
|
|
210
|
+
- Migrate: `bin/rails db:migrate`
|
|
211
|
+
- Routes: `bin/rails routes`
|
|
212
|
+
- Generate: `bin/rails generate ...`
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### Template: iOS
|
|
218
|
+
|
|
219
|
+
```markdown
|
|
220
|
+
# Project: {project-name}
|
|
221
|
+
|
|
222
|
+
## Stack
|
|
223
|
+
- Language: Swift {version}+
|
|
224
|
+
- UI: SwiftUI
|
|
225
|
+
- Architecture: MVVM
|
|
226
|
+
- Testing: XCTest + Swift Testing
|
|
227
|
+
- Linting: SwiftLint
|
|
228
|
+
- Package manager: Swift Package Manager
|
|
229
|
+
|
|
230
|
+
## Verification
|
|
231
|
+
Run in this order — all must pass before any PR:
|
|
232
|
+
1. `swiftlint lint --strict`
|
|
233
|
+
2. `xcodebuild test -scheme {scheme-name} -destination 'platform=iOS Simulator,name=iPhone 16'`
|
|
234
|
+
|
|
235
|
+
## Conventions
|
|
236
|
+
- `PascalCase` for types, `camelCase` for variables and functions
|
|
237
|
+
- `@State` and `@StateObject` only in Views — all business logic in ViewModels
|
|
238
|
+
- `async`/`await` for all async operations — no completion handlers in new code
|
|
239
|
+
- No force unwrap (`!`) in production code — use `guard let` or `if let`
|
|
240
|
+
- Separate concerns: Views (UI only), ViewModels (logic), Services (data/network)
|
|
241
|
+
|
|
242
|
+
## Key Commands
|
|
243
|
+
- Build: `xcodebuild build -scheme {scheme-name}`
|
|
244
|
+
- Open project: `open {project-name}.xcodeproj`
|
|
245
|
+
- SPM resolve: `swift package resolve`
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
### Template: Go
|
|
251
|
+
|
|
252
|
+
```markdown
|
|
253
|
+
# Project: {project-name}
|
|
254
|
+
|
|
255
|
+
## Stack
|
|
256
|
+
- Language: Go {version}
|
|
257
|
+
- Framework: {net/http / Gin / Echo / Chi}
|
|
258
|
+
- Testing: go test
|
|
259
|
+
- Linting: golangci-lint
|
|
260
|
+
- DB: {pgx / GORM / sqlx / none}
|
|
261
|
+
|
|
262
|
+
## Verification
|
|
263
|
+
Run in this order — all must pass before any PR:
|
|
264
|
+
1. `golangci-lint run`
|
|
265
|
+
2. `go vet ./...`
|
|
266
|
+
3. `go test ./...`
|
|
267
|
+
4. `go build ./...`
|
|
268
|
+
|
|
269
|
+
## Conventions
|
|
270
|
+
- Always check errors — never ignore with `_`
|
|
271
|
+
- Package names: short, lowercase, no underscores
|
|
272
|
+
- Interfaces defined at the consumer (not the producer)
|
|
273
|
+
- `context.Context` as first argument for all I/O operations
|
|
274
|
+
- Table-driven tests for pure functions
|
|
275
|
+
|
|
276
|
+
## Key Commands
|
|
277
|
+
- Run: `go run .`
|
|
278
|
+
- Module tidy: `go mod tidy`
|
|
279
|
+
- Format: `gofmt -w .`
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
### Template: Node.js
|
|
285
|
+
|
|
286
|
+
```markdown
|
|
287
|
+
# Project: {project-name}
|
|
288
|
+
|
|
289
|
+
## Stack
|
|
290
|
+
- Language: TypeScript
|
|
291
|
+
- Runtime: Node.js {version}
|
|
292
|
+
- Framework: {Express / Fastify / Hono / Koa}
|
|
293
|
+
- Testing: Vitest
|
|
294
|
+
- Linting: Biome
|
|
295
|
+
- DB: {Drizzle / Prisma / none}
|
|
296
|
+
|
|
297
|
+
## Verification
|
|
298
|
+
Run in this order — all must pass before any PR:
|
|
299
|
+
1. `npx biome check --write .`
|
|
300
|
+
2. `npm run type-check`
|
|
301
|
+
3. `npm run test`
|
|
302
|
+
4. `npm run build`
|
|
303
|
+
|
|
304
|
+
## Conventions
|
|
305
|
+
- No `any` types — use proper TypeScript
|
|
306
|
+
- `async`/`await` — no raw callbacks
|
|
307
|
+
- `snake_case` for database columns, `camelCase` for TypeScript
|
|
308
|
+
- Centralised error handling middleware
|
|
309
|
+
- Route handlers thin — business logic in service layer
|
|
310
|
+
|
|
311
|
+
## Key Commands
|
|
312
|
+
- Dev: `npm run dev`
|
|
313
|
+
- Build: `npm run build`
|
|
314
|
+
- Install: `npm install`
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
### Template: Custom
|
|
320
|
+
|
|
321
|
+
Ask the user these questions one at a time:
|
|
322
|
+
|
|
323
|
+
1. "What language and version?"
|
|
324
|
+
2. "What framework or runtime (if any)?"
|
|
325
|
+
3. "What test runner?"
|
|
326
|
+
4. "What linter / formatter?"
|
|
327
|
+
5. "What are the exact verification commands to run before every PR?"
|
|
328
|
+
6. "Any key naming or structural conventions to enforce?"
|
|
329
|
+
|
|
330
|
+
Generate a CLAUDE.md in the same structure as the templates above.
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Step 5: Confirm
|
|
335
|
+
|
|
336
|
+
Show the generated content and ask: "Does this look right? Anything to adjust?"
|
|
337
|
+
|
|
338
|
+
Apply any corrections, then write the file.
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
mkdir -p .claude
|
|
342
|
+
git add .claude/CLAUDE.md
|
|
343
|
+
git commit -m "chore: add project rules for {stack}"
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Report: "Project rules created. QA and developer agents will now read `.claude/CLAUDE.md` for stack conventions and verification commands."
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Notes
|
|
351
|
+
|
|
352
|
+
- The Verification section drives the QA agent — get these commands right
|
|
353
|
+
- The Conventions section drives the developer agent — be specific about type safety rules
|
|
354
|
+
- Run `/create-rules` again any time the stack changes significantly
|
|
355
|
+
- Partners on the same project get these rules automatically via git clone
|
|
356
|
+
- To disable the Glori Builder welcome message for this project, add `quetrex_welcome: false` anywhere in this file
|