@gordon.gan/specflow 1.4.0-beta → 1.4.1

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 (82) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/prompts/approval/database-guidance.md +79 -0
  4. package/prompts/approval/generate.md +569 -290
  5. package/skills/database/LICENSE +405 -0
  6. package/skills/database/ORIGIN.md +6 -0
  7. package/skills/database/README.md +30 -0
  8. package/skills/database/elasticsearch/LICENSE.txt +202 -0
  9. package/skills/database/elasticsearch/SKILL.md +199 -0
  10. package/skills/database/elasticsearch/examples/01-fulltext-search.md +215 -0
  11. package/skills/database/elasticsearch/examples/02-aggregation-report.md +206 -0
  12. package/skills/database/elasticsearch/examples/03-reindex-zero-downtime.md +200 -0
  13. package/skills/database/elasticsearch/examples/04-cluster-monitoring.md +204 -0
  14. package/skills/database/elasticsearch/references/01-query-dsl-fulltext.md +162 -0
  15. package/skills/database/elasticsearch/references/02-query-dsl-term.md +210 -0
  16. package/skills/database/elasticsearch/references/03-aggregations-metric.md +161 -0
  17. package/skills/database/elasticsearch/references/04-aggregations-bucket.md +236 -0
  18. package/skills/database/elasticsearch/references/05-mapping-types.md +134 -0
  19. package/skills/database/elasticsearch/references/06-analyzers.md +187 -0
  20. package/skills/database/elasticsearch/references/07-cluster-ops.md +225 -0
  21. package/skills/database/elasticsearch/references/08-elk-integration.md +170 -0
  22. package/skills/database/mysql/SKILL.md +195 -0
  23. package/skills/database/mysql/examples/01-connection-pool.md +75 -0
  24. package/skills/database/mysql/examples/02-slow-query-optimization.md +98 -0
  25. package/skills/database/mysql/examples/03-master-slave-setup.md +144 -0
  26. package/skills/database/mysql/examples/04-backup-strategy.md +212 -0
  27. package/skills/database/mysql/references/01-functions-string.md +103 -0
  28. package/skills/database/mysql/references/02-functions-date.md +152 -0
  29. package/skills/database/mysql/references/03-functions-aggregate-window.md +167 -0
  30. package/skills/database/mysql/references/04-functions-json.md +129 -0
  31. package/skills/database/mysql/references/05-sql-ddl-types.md +235 -0
  32. package/skills/database/mysql/references/06-index-optimization.md +232 -0
  33. package/skills/database/mysql/references/07-replication-ha.md +213 -0
  34. package/skills/database/mysql/references/08-backup-restore.md +207 -0
  35. package/skills/database/mysql/references/09-advanced-features.md +345 -0
  36. package/skills/database/oracle/LICENSE.txt +202 -0
  37. package/skills/database/oracle/SKILL.md +238 -0
  38. package/skills/database/oracle/examples/01-plsql-procedure.md +90 -0
  39. package/skills/database/oracle/examples/02-awr-analysis.md +99 -0
  40. package/skills/database/oracle/examples/03-rman-backup.md +108 -0
  41. package/skills/database/oracle/examples/04-dataguard-setup.md +146 -0
  42. package/skills/database/oracle/references/01-functions-string.md +91 -0
  43. package/skills/database/oracle/references/02-functions-date.md +71 -0
  44. package/skills/database/oracle/references/03-analytic-functions.md +103 -0
  45. package/skills/database/oracle/references/04-plsql-guide.md +303 -0
  46. package/skills/database/oracle/references/05-performance-tuning.md +164 -0
  47. package/skills/database/oracle/references/06-backup-recovery.md +115 -0
  48. package/skills/database/oracle/references/07-dataguard-rac.md +76 -0
  49. package/skills/database/oracle/references/08-security.md +170 -0
  50. package/skills/database/oracle/references/09-sql-syntax.md +152 -0
  51. package/skills/database/oracle/references/10-features.md +174 -0
  52. package/skills/database/postgresql/LICENSE.txt +202 -0
  53. package/skills/database/postgresql/SKILL.md +182 -0
  54. package/skills/database/postgresql/examples/.gitkeep +0 -0
  55. package/skills/database/postgresql/examples/01-jsonb-query.md +72 -0
  56. package/skills/database/postgresql/examples/02-cte-recursive.md +110 -0
  57. package/skills/database/postgresql/examples/03-performance-tuning.md +114 -0
  58. package/skills/database/postgresql/examples/04-streaming-replication.md +113 -0
  59. package/skills/database/postgresql/references/.gitkeep +0 -0
  60. package/skills/database/postgresql/references/01-functions-string.md +174 -0
  61. package/skills/database/postgresql/references/02-functions-datetime.md +54 -0
  62. package/skills/database/postgresql/references/03-functions-aggregate-window.md +142 -0
  63. package/skills/database/postgresql/references/04-functions-jsonb.md +117 -0
  64. package/skills/database/postgresql/references/05-fulltext-search.md +109 -0
  65. package/skills/database/postgresql/references/06-index-types.md +95 -0
  66. package/skills/database/postgresql/references/07-partition-fdw.md +133 -0
  67. package/skills/database/postgresql/references/08-replication-backup.md +215 -0
  68. package/skills/database/redis/LICENSE.txt +202 -0
  69. package/skills/database/redis/SKILL.md +922 -0
  70. package/skills/database/redis/examples/01-cache-usage.md +104 -0
  71. package/skills/database/redis/examples/02-session-storage.md +72 -0
  72. package/skills/database/redis/examples/03-leaderboard.md +63 -0
  73. package/skills/database/redis/examples/04-redis-cluster-setup.md +70 -0
  74. package/skills/database/redis/examples/05-stream-queue.md +65 -0
  75. package/skills/database/redis/references/command-quick-ref.md +180 -0
  76. package/skills/database/redis/references/commands-admin-key.md +413 -0
  77. package/skills/database/redis/references/commands-set-sorted-advanced.md +539 -0
  78. package/skills/database/redis/references/commands-string-hash-list.md +458 -0
  79. package/skills/database/redis/references/memory-optimization.md +150 -0
  80. package/skills/database/redis/references/redis-conf-production.md +139 -0
  81. package/skills/specflow-approval/SKILL.md +100 -181
  82. package/templates/approval.md +295 -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.0-beta
129
+ specflow --version # 以 npm / package.json 为准(当前 1.4.1
130
130
  specflow --help
131
131
  ```
132
132
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gordon.gan/specflow",
3
- "version": "1.4.0-beta",
3
+ "version": "1.4.1",
4
4
  "type": "module",
5
5
  "description": "SpecFlow — unified spec-driven development: OpenSpec planning + Superpowers execution in one CLI and cross-IDE workflow",
6
6
  "keywords": [
@@ -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`.