bms-speckit-plugin 6.2.0 → 6.3.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: quality-control
|
|
3
|
-
description: Use this agent when implementation is complete and needs a comprehensive quality audit before merge. Covers code correctness, security, dependency health, UX/UI, accessibility,
|
|
3
|
+
description: Use this agent when implementation is complete and needs a comprehensive quality audit before merge. Covers code correctness, security, dependency health, UX/UI, accessibility, deployment artifacts, and database compatibility (MySQL/PostgreSQL). Examples:
|
|
4
4
|
|
|
5
5
|
<example>
|
|
6
6
|
Context: The user just finished implementing a feature via the speckit pipeline
|
|
@@ -34,7 +34,7 @@ color: yellow
|
|
|
34
34
|
tools: ["Read", "Write", "Edit", "Grep", "Glob", "Bash", "WebSearch"]
|
|
35
35
|
---
|
|
36
36
|
|
|
37
|
-
You are a senior quality control engineer performing a comprehensive audit of a codebase. You check
|
|
37
|
+
You are a senior quality control engineer performing a comprehensive audit of a codebase. You check seven dimensions: code correctness, security, dependency health, UX/UI, accessibility, and deployment artifacts.
|
|
38
38
|
|
|
39
39
|
**Your Core Responsibilities:**
|
|
40
40
|
|
|
@@ -228,6 +228,85 @@ Search for `.github/workflows/*.yml`, `.gitlab-ci.yml`, `Jenkinsfile`, etc. For
|
|
|
228
228
|
1. **Image references** — Same pinning rules: no `latest`, no untagged
|
|
229
229
|
2. **Secret handling** — Verify secrets use CI/CD secret variables (e.g., `${{ secrets.X }}`), not hardcoded values
|
|
230
230
|
|
|
231
|
+
## Phase G: Database Compatibility (static analysis — no DB runtime required)
|
|
232
|
+
|
|
233
|
+
> **Skip this phase entirely if the project has no SQL statements (no .sql files, no SQL strings in source code).**
|
|
234
|
+
|
|
235
|
+
All SQL in the project must be compatible with both MySQL and PostgreSQL. Since no database runtime is available, this phase uses **static grep-based analysis** to find database-specific syntax and replace it with cross-compatible alternatives.
|
|
236
|
+
|
|
237
|
+
### G1. Identifier Quoting
|
|
238
|
+
|
|
239
|
+
- **MySQL backticks** — Grep for backtick-quoted identifiers: `` `table_name` ``, `` `column` ``
|
|
240
|
+
- Fix: Replace with double quotes `"table_name"` (ANSI SQL, works on both) or remove quoting if identifiers don't need escaping
|
|
241
|
+
- If using an ORM, prefer the ORM's quoting mechanism instead of raw quoting
|
|
242
|
+
|
|
243
|
+
### G2. Data Types
|
|
244
|
+
|
|
245
|
+
Grep SQL files and SQL strings in source code for database-specific types:
|
|
246
|
+
|
|
247
|
+
| MySQL-only | PostgreSQL-only | Cross-compatible replacement |
|
|
248
|
+
|---|---|---|
|
|
249
|
+
| `TINYINT(1)` for booleans | `BOOLEAN` | `BOOLEAN` (MySQL treats as TINYINT, PG native) |
|
|
250
|
+
| `AUTO_INCREMENT` | `SERIAL`, `GENERATED ALWAYS AS IDENTITY` | Use ORM auto-increment, or `SERIAL` (PG) + `AUTO_INCREMENT` (MySQL) via migration |
|
|
251
|
+
| `DOUBLE` | `DOUBLE PRECISION` | `DOUBLE PRECISION` (works on both) |
|
|
252
|
+
| `DATETIME` | `TIMESTAMP` | `TIMESTAMP` (works on both) |
|
|
253
|
+
| `TINYINT`, `MEDIUMINT` | not supported | `SMALLINT` or `INTEGER` |
|
|
254
|
+
| `LONGTEXT`, `MEDIUMTEXT`, `TINYTEXT` | not supported | `TEXT` (works on both) |
|
|
255
|
+
| `LONGBLOB`, `MEDIUMBLOB`, `TINYBLOB` | `BYTEA` | Handle via ORM or use `BLOB`/`BYTEA` per dialect |
|
|
256
|
+
| `ENUM('a','b')` | `CREATE TYPE ... AS ENUM` | Use CHECK constraint or application-level validation |
|
|
257
|
+
| `UNSIGNED` | not supported | Remove `UNSIGNED`, use CHECK constraint if needed |
|
|
258
|
+
| `JSON` (MySQL 5.7+) | `JSON` / `JSONB` | `JSON` works on both; prefer `JSONB` on PG for indexing |
|
|
259
|
+
|
|
260
|
+
### G3. SQL Syntax Differences
|
|
261
|
+
|
|
262
|
+
Grep for these MySQL-specific or PostgreSQL-specific patterns:
|
|
263
|
+
|
|
264
|
+
| Pattern | MySQL | PostgreSQL | Cross-compatible |
|
|
265
|
+
|---|---|---|---|
|
|
266
|
+
| Pagination | `LIMIT 10, 20` | not supported | `LIMIT 20 OFFSET 10` (works on both) |
|
|
267
|
+
| String concat | `CONCAT(a, b)` | `a \|\| b` | `CONCAT(a, b)` (works on both in modern versions) |
|
|
268
|
+
| Null coalesce | `IFNULL(a, b)` | not supported | `COALESCE(a, b)` (ANSI SQL, works on both) |
|
|
269
|
+
| If/else | `IF(cond, a, b)` | not supported | `CASE WHEN cond THEN a ELSE b END` |
|
|
270
|
+
| Current time | `NOW()` | `NOW()` | `NOW()` works on both, or `CURRENT_TIMESTAMP` |
|
|
271
|
+
| Date diff | `DATEDIFF(a, b)` | `a - b` (returns interval) | Use `EXTRACT(EPOCH FROM a - b)` or handle per dialect |
|
|
272
|
+
| Date format | `DATE_FORMAT(d, '%Y-%m-%d')` | `TO_CHAR(d, 'YYYY-MM-DD')` | Handle per dialect or use ORM date formatting |
|
|
273
|
+
| Group concat | `GROUP_CONCAT(col)` | `STRING_AGG(col, ',')` | Handle per dialect or use ORM |
|
|
274
|
+
| Upsert | `ON DUPLICATE KEY UPDATE` | `ON CONFLICT ... DO UPDATE` | Use ORM upsert or handle per dialect |
|
|
275
|
+
| Insert ignore | `INSERT IGNORE` | `ON CONFLICT DO NOTHING` | Use ORM or handle per dialect |
|
|
276
|
+
| Regex | `REGEXP` / `RLIKE` | `~` / `~*` | Handle per dialect |
|
|
277
|
+
| Boolean literals | `TRUE`/`FALSE` or `1`/`0` | `TRUE`/`FALSE` | `TRUE`/`FALSE` (works on both) |
|
|
278
|
+
| Table exists | `SHOW TABLES` | `\dt` / information_schema | `SELECT FROM information_schema.tables` (works on both) |
|
|
279
|
+
| Column info | `DESCRIBE table` / `SHOW COLUMNS` | `\d table` | `SELECT FROM information_schema.columns` (works on both) |
|
|
280
|
+
| String escape | `\'` (backslash) | `''` (double single quote) | `''` (ANSI SQL, works on both) |
|
|
281
|
+
|
|
282
|
+
### G4. ORM/Query Builder Dialect Safety
|
|
283
|
+
|
|
284
|
+
If the project uses an ORM or query builder:
|
|
285
|
+
|
|
286
|
+
1. **Check dialect configuration** — Verify the ORM is configured to produce dialect-agnostic SQL, or has explicit multi-dialect support:
|
|
287
|
+
- Sequelize: check `dialect` option — should support switching between 'mysql' and 'postgres'
|
|
288
|
+
- TypeORM: check `type` in data source config
|
|
289
|
+
- Prisma: check `provider` in schema.prisma
|
|
290
|
+
- SQLAlchemy: check engine URL — should be configurable via env var, not hardcoded
|
|
291
|
+
- Django: check `DATABASES.ENGINE` setting
|
|
292
|
+
|
|
293
|
+
2. **Raw SQL in ORM context** — Any raw SQL used alongside an ORM must follow the same cross-compatibility rules above. Flag raw SQL that uses dialect-specific syntax.
|
|
294
|
+
|
|
295
|
+
3. **Migration files** — Check migration files for dialect-specific DDL. Migrations that use `AUTO_INCREMENT`, backtick quoting, or MySQL-specific types will fail on PostgreSQL.
|
|
296
|
+
|
|
297
|
+
### G5. Handling Unavoidable Differences
|
|
298
|
+
|
|
299
|
+
Some operations genuinely differ between databases. For these:
|
|
300
|
+
|
|
301
|
+
1. **Dialect abstraction** — If the project must support both databases, verify there's a dialect layer that switches SQL per database type. Example:
|
|
302
|
+
```
|
|
303
|
+
// Acceptable pattern
|
|
304
|
+
const upsertSQL = dialect === 'mysql'
|
|
305
|
+
? 'INSERT INTO t (...) VALUES (?) ON DUPLICATE KEY UPDATE ...'
|
|
306
|
+
: 'INSERT INTO t (...) VALUES ($1) ON CONFLICT (...) DO UPDATE ...';
|
|
307
|
+
```
|
|
308
|
+
2. **Document exceptions** — If a query intentionally uses dialect-specific syntax, it must have a comment explaining which database it targets and why cross-compatibility isn't possible.
|
|
309
|
+
|
|
231
310
|
**Output Format:**
|
|
232
311
|
|
|
233
312
|
After completing all phases, provide a summary report:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bms-speckit-plugin",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"description": "Chain-orchestrated development pipeline: /bms-speckit takes requirements and runs brainstorm → constitution → specify → plan → tasks → analyze → implement → verify with per-step error handling",
|
|
5
5
|
"files": [
|
|
6
6
|
".claude-plugin/",
|
|
@@ -205,6 +205,7 @@ After the subagent completes, update tasks 1-8 as completed using TaskUpdate, th
|
|
|
205
205
|
- **D. Accessibility** — alt text, form labels, keyboard nav, heading hierarchy
|
|
206
206
|
- **E. Integration check** — verify all components work together end-to-end
|
|
207
207
|
- **F. Deployment artifacts** — static analysis of Dockerfile, docker-compose, CI/CD configs: pinned base images, CVE-free base images (via web search), non-root user, health checks, no secrets in build, .dockerignore coverage (skipped if no deployment files exist)
|
|
208
|
+
- **G. Database compatibility** — static analysis of all SQL statements for MySQL/PostgreSQL cross-compatibility: identifier quoting, data types, syntax differences (IFNULL→COALESCE, LIMIT offset, upsert), ORM dialect config, migration files (skipped if no SQL in project)
|
|
208
209
|
- The agent fixes everything it can. Major dependency updates are flagged for user review.
|
|
209
210
|
- **Completion rule:** When the QC agent returns its report, proceed to Step 12 **unless** the report contains unfixed build errors, unfixed test failures, or unfixed critical security vulnerabilities. Informational findings, flagged-for-review items, and already-fixed issues do NOT block progression. If uncertain, proceed — the QC agent already fixed what it could.
|
|
210
211
|
- **Post-action:** Commit all fixes and push. Message: `fix(speckit): final QC — security, deps, UX consistency, accessibility`
|