@gordon.gan/specflow 1.4.0-beta → 1.4.2-beta
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/README.md +1 -1
- package/package.json +1 -1
- package/prompts/approval/database-guidance.md +79 -0
- package/prompts/approval/generate.md +600 -290
- package/skills/database/LICENSE +405 -0
- package/skills/database/ORIGIN.md +6 -0
- package/skills/database/README.md +30 -0
- package/skills/database/elasticsearch/LICENSE.txt +202 -0
- package/skills/database/elasticsearch/SKILL.md +199 -0
- package/skills/database/elasticsearch/examples/01-fulltext-search.md +215 -0
- package/skills/database/elasticsearch/examples/02-aggregation-report.md +206 -0
- package/skills/database/elasticsearch/examples/03-reindex-zero-downtime.md +200 -0
- package/skills/database/elasticsearch/examples/04-cluster-monitoring.md +204 -0
- package/skills/database/elasticsearch/references/01-query-dsl-fulltext.md +162 -0
- package/skills/database/elasticsearch/references/02-query-dsl-term.md +210 -0
- package/skills/database/elasticsearch/references/03-aggregations-metric.md +161 -0
- package/skills/database/elasticsearch/references/04-aggregations-bucket.md +236 -0
- package/skills/database/elasticsearch/references/05-mapping-types.md +134 -0
- package/skills/database/elasticsearch/references/06-analyzers.md +187 -0
- package/skills/database/elasticsearch/references/07-cluster-ops.md +225 -0
- package/skills/database/elasticsearch/references/08-elk-integration.md +170 -0
- package/skills/database/mysql/SKILL.md +195 -0
- package/skills/database/mysql/examples/01-connection-pool.md +75 -0
- package/skills/database/mysql/examples/02-slow-query-optimization.md +98 -0
- package/skills/database/mysql/examples/03-master-slave-setup.md +144 -0
- package/skills/database/mysql/examples/04-backup-strategy.md +212 -0
- package/skills/database/mysql/references/01-functions-string.md +103 -0
- package/skills/database/mysql/references/02-functions-date.md +152 -0
- package/skills/database/mysql/references/03-functions-aggregate-window.md +167 -0
- package/skills/database/mysql/references/04-functions-json.md +129 -0
- package/skills/database/mysql/references/05-sql-ddl-types.md +235 -0
- package/skills/database/mysql/references/06-index-optimization.md +232 -0
- package/skills/database/mysql/references/07-replication-ha.md +213 -0
- package/skills/database/mysql/references/08-backup-restore.md +207 -0
- package/skills/database/mysql/references/09-advanced-features.md +345 -0
- package/skills/database/oracle/LICENSE.txt +202 -0
- package/skills/database/oracle/SKILL.md +238 -0
- package/skills/database/oracle/examples/01-plsql-procedure.md +90 -0
- package/skills/database/oracle/examples/02-awr-analysis.md +99 -0
- package/skills/database/oracle/examples/03-rman-backup.md +108 -0
- package/skills/database/oracle/examples/04-dataguard-setup.md +146 -0
- package/skills/database/oracle/references/01-functions-string.md +91 -0
- package/skills/database/oracle/references/02-functions-date.md +71 -0
- package/skills/database/oracle/references/03-analytic-functions.md +103 -0
- package/skills/database/oracle/references/04-plsql-guide.md +303 -0
- package/skills/database/oracle/references/05-performance-tuning.md +164 -0
- package/skills/database/oracle/references/06-backup-recovery.md +115 -0
- package/skills/database/oracle/references/07-dataguard-rac.md +76 -0
- package/skills/database/oracle/references/08-security.md +170 -0
- package/skills/database/oracle/references/09-sql-syntax.md +152 -0
- package/skills/database/oracle/references/10-features.md +174 -0
- package/skills/database/postgresql/LICENSE.txt +202 -0
- package/skills/database/postgresql/SKILL.md +182 -0
- package/skills/database/postgresql/examples/.gitkeep +0 -0
- package/skills/database/postgresql/examples/01-jsonb-query.md +72 -0
- package/skills/database/postgresql/examples/02-cte-recursive.md +110 -0
- package/skills/database/postgresql/examples/03-performance-tuning.md +114 -0
- package/skills/database/postgresql/examples/04-streaming-replication.md +113 -0
- package/skills/database/postgresql/references/.gitkeep +0 -0
- package/skills/database/postgresql/references/01-functions-string.md +174 -0
- package/skills/database/postgresql/references/02-functions-datetime.md +54 -0
- package/skills/database/postgresql/references/03-functions-aggregate-window.md +142 -0
- package/skills/database/postgresql/references/04-functions-jsonb.md +117 -0
- package/skills/database/postgresql/references/05-fulltext-search.md +109 -0
- package/skills/database/postgresql/references/06-index-types.md +95 -0
- package/skills/database/postgresql/references/07-partition-fdw.md +133 -0
- package/skills/database/postgresql/references/08-replication-backup.md +215 -0
- package/skills/database/redis/LICENSE.txt +202 -0
- package/skills/database/redis/SKILL.md +922 -0
- package/skills/database/redis/examples/01-cache-usage.md +104 -0
- package/skills/database/redis/examples/02-session-storage.md +72 -0
- package/skills/database/redis/examples/03-leaderboard.md +63 -0
- package/skills/database/redis/examples/04-redis-cluster-setup.md +70 -0
- package/skills/database/redis/examples/05-stream-queue.md +65 -0
- package/skills/database/redis/references/command-quick-ref.md +180 -0
- package/skills/database/redis/references/commands-admin-key.md +413 -0
- package/skills/database/redis/references/commands-set-sorted-advanced.md +539 -0
- package/skills/database/redis/references/commands-string-hash-list.md +458 -0
- package/skills/database/redis/references/memory-optimization.md +150 -0
- package/skills/database/redis/references/redis-conf-production.md +139 -0
- package/skills/specflow-approval/SKILL.md +102 -181
- package/templates/approval.md +321 -221
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ npm install -g @gordon.gan/specflow
|
|
|
126
126
|
npm install -g github:Gordon-Gan-Jiang/specflow
|
|
127
127
|
|
|
128
128
|
# 验证
|
|
129
|
-
specflow --version # 以 npm / package.json 为准(当前 1.4.
|
|
129
|
+
specflow --version # 以 npm / package.json 为准(当前 1.4.2-beta)
|
|
130
130
|
specflow --help
|
|
131
131
|
```
|
|
132
132
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Approval · Database Guidance Router
|
|
2
|
+
|
|
3
|
+
> Used by `/specflow:approval` when generating §4.4 (数据结构 / 数据模型).
|
|
4
|
+
> **本地技能**: `skills/database/`(本仓库长期维护)。
|
|
5
|
+
> **禁止**依赖远程 skill 仓库(禁止 `npx skills add` / clone / 运行时 fetch)。
|
|
6
|
+
> **Not** an MCP tool — on hit, `Read` local matched skill files; on miss, LLM-only §4.4.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 1. Detect project database stack
|
|
11
|
+
|
|
12
|
+
Scan the **project under review** (change's repo root), not SpecFlow itself. Collect signals
|
|
13
|
+
(non-recursive first; optional one-level into `docker-compose*.yml` / `migrations/`).
|
|
14
|
+
|
|
15
|
+
| Signal | Suggested stack |
|
|
16
|
+
|--------|-----------------|
|
|
17
|
+
| `go.mod` / deps: `go-sql-driver/mysql`, `gorm.io` + mysql DSN, `ENGINE=InnoDB` in `*.sql` | `mysql` |
|
|
18
|
+
| `package.json`: `mysql2`, `mysql`, `@prisma/client` + datasource mysql, drizzle mysql | `mysql` |
|
|
19
|
+
| `pyproject` / requirements: `PyMySQL`, `mysqlclient`, `aiomysql` | `mysql` |
|
|
20
|
+
| `go.mod`: `jackc/pgx`, `lib/pq`; `package.json`: `pg`, `postgres`; Prisma/drizzle postgres | `postgresql` |
|
|
21
|
+
| `docker-compose`: image `postgres` / `mysql` / `mariadb` / `redis` / `elasticsearch` | matching image |
|
|
22
|
+
| SQL files with `ENGINE=InnoDB` / `CHARSET=utf8mb4` | `mysql` |
|
|
23
|
+
| SQL with `JSONB`, `SERIAL`, `gen_random_uuid()` | `postgresql` |
|
|
24
|
+
| Oracle JDBC / `oracledb` / `go-ora` | `oracle` |
|
|
25
|
+
| `ioredis` / `redis` client / `go-redis` | `redis` (cache/KV — usually **not** §4.4 relational DDL) |
|
|
26
|
+
| `@elastic/elasticsearch` / OpenSearch client | `elasticsearch` (search — usually not relational DDL) |
|
|
27
|
+
|
|
28
|
+
**Multi-hit**: pick primary OLTP store for §4.4 (prefer `mysql` / `postgresql` / `oracle` over
|
|
29
|
+
`redis` / `elasticsearch`). Mention secondary stores in §4.7/架构 if relevant.
|
|
30
|
+
|
|
31
|
+
**Announce** after detection:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
DB stack for approval: <mysql|postgresql|oracle|redis|elasticsearch|none>
|
|
35
|
+
Guidance: skills/database/<stack>/SKILL.md | LLM-fallback
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 2. On hit — load **local** guidance (Read, do not invent, do not fetch)
|
|
41
|
+
|
|
42
|
+
Base: `skills/database/<stack>/`(相对 SpecFlow 仓库根;离线可读)
|
|
43
|
+
|
|
44
|
+
| Stack | Must Read | Also Read when §4.4 needs it |
|
|
45
|
+
|-------|-----------|------------------------------|
|
|
46
|
+
| `mysql` | `SKILL.md` | `references/05-sql-ddl-types.md`, `references/06-index-optimization.md`; JSON → `references/04-functions-json.md` |
|
|
47
|
+
| `postgresql` | `SKILL.md` | `references/06-index-types.md`; JSONB → `references/04-functions-jsonb.md` |
|
|
48
|
+
| `oracle` | `SKILL.md` | `references/09-sql-syntax.md`, `references/10-features.md` |
|
|
49
|
+
| `redis` | `SKILL.md` | Only if change is cache/key design — **not** a substitute for relational DDL |
|
|
50
|
+
| `elasticsearch` | `SKILL.md` | Only if change is index/mapping — **not** a substitute for relational DDL |
|
|
51
|
+
|
|
52
|
+
Apply guidance to §4.4 output:
|
|
53
|
+
|
|
54
|
+
1. Prefer engine/charset/collation idioms from the local skill (MySQL: InnoDB + utf8mb4…).
|
|
55
|
+
2. Prefer type/index gotchas from the skill (e.g. DECIMAL for money, no FLOAT amounts).
|
|
56
|
+
3. Keep SpecFlow hard rules (ER, full CREATE TABLE, 本迭代用法, G3/G4) — skill **supplements**, does not replace.
|
|
57
|
+
|
|
58
|
+
Cite in §4.4 总则, e.g. `DB 技能: skills/database/mysql (本地)`.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 3. On miss — LLM fallback
|
|
63
|
+
|
|
64
|
+
If `DB stack = none` (no durable store signals, or only unknown/custom DB):
|
|
65
|
+
|
|
66
|
+
1. **Do not** force-load mysql/postgresql skills.
|
|
67
|
+
2. Generate §4.4 with SpecFlow rules only (`generate.md` §4.4 + Quality Gates G3/G4).
|
|
68
|
+
3. If design/tasks claim a DB but signals are absent → `WARNING` in §8:
|
|
69
|
+
`design 声称落库但未检测到 DB 栈信号 — 已用 LLM 通用 DDL;建议 refine 标明引擎`.
|
|
70
|
+
4. Pure CLI/config changes → keep `不涉及数据库变更(...)`.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 4. Why not remote skills / MCP tools?
|
|
75
|
+
|
|
76
|
+
- **Remote**: approval must work offline and must not drift with upstream installs; maintain
|
|
77
|
+
`skills/database/` in this repo.
|
|
78
|
+
- **MCP tools**: these packs are markdown guidance, not APIs; routing chooses which local
|
|
79
|
+
files to `Read`.
|