specweave 0.23.18 → 0.24.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 (174) hide show
  1. package/.claude-plugin/marketplace.json +144 -45
  2. package/CLAUDE.md +137 -4
  3. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
  4. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
  5. package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
  6. package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
  7. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
  8. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
  9. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
  10. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
  11. package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
  12. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  13. package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
  14. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  15. package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
  16. package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
  17. package/dist/src/cli/helpers/smart-filter.js +265 -0
  18. package/dist/src/cli/helpers/smart-filter.js.map +1 -0
  19. package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
  20. package/dist/src/core/qa/quality-gate-decider.js +2 -2
  21. package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
  22. package/dist/src/core/qa/risk-calculator.d.ts +2 -2
  23. package/dist/src/core/qa/risk-calculator.js +2 -2
  24. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  25. package/dist/src/core/repo-structure/repo-structure-manager.js +76 -43
  26. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  27. package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
  28. package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
  29. package/dist/src/core/validators/ac-presence-validator.js +149 -0
  30. package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
  31. package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
  32. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
  33. package/dist/src/integrations/ado/area-path-mapper.js +267 -0
  34. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
  35. package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
  36. package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
  37. package/dist/src/integrations/jira/filter-processor.js +207 -0
  38. package/dist/src/integrations/jira/filter-processor.js.map +1 -0
  39. package/dist/src/integrations/jira/jira-client.d.ts +13 -0
  40. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  41. package/dist/src/integrations/jira/jira-client.js +33 -0
  42. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  43. package/dist/src/utils/ac-embedder.d.ts +63 -0
  44. package/dist/src/utils/ac-embedder.d.ts.map +1 -0
  45. package/dist/src/utils/ac-embedder.js +217 -0
  46. package/dist/src/utils/ac-embedder.js.map +1 -0
  47. package/dist/src/utils/env-manager.d.ts +86 -0
  48. package/dist/src/utils/env-manager.d.ts.map +1 -0
  49. package/dist/src/utils/env-manager.js +188 -0
  50. package/dist/src/utils/env-manager.js.map +1 -0
  51. package/package.json +1 -1
  52. package/plugins/specweave/.claude-plugin/plugin.json +1 -1
  53. package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
  54. package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
  55. package/plugins/specweave/commands/specweave-do.md +37 -0
  56. package/plugins/specweave/commands/specweave-done.md +159 -0
  57. package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
  58. package/plugins/specweave/commands/specweave-next.md +148 -3
  59. package/plugins/specweave/commands/specweave-qa.md +2 -2
  60. package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
  61. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  62. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  63. package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
  64. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
  65. package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
  66. package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
  67. package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
  68. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
  69. package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
  70. package/plugins/specweave-backend/commands/crud-generate.md +109 -0
  71. package/plugins/specweave-backend/commands/migration-generate.md +139 -0
  72. package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
  73. package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
  74. package/plugins/specweave-confluent/commands/schema-register.md +123 -0
  75. package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
  76. package/plugins/specweave-core/commands/architecture-review.md +288 -0
  77. package/plugins/specweave-core/commands/code-review.md +213 -0
  78. package/plugins/specweave-core/commands/refactor-plan.md +249 -0
  79. package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
  80. package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
  81. package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
  82. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
  83. package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
  84. package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
  85. package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
  86. package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
  87. package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
  88. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  89. package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
  90. package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
  91. package/plugins/specweave-docs/commands/docs-generate.md +441 -0
  92. package/plugins/specweave-docs/commands/docs-init.md +334 -0
  93. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
  94. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
  95. package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
  96. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  97. package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
  98. package/plugins/specweave-figma/commands/figma-import.md +690 -0
  99. package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
  100. package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
  101. package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
  102. package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +408 -0
  103. package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
  104. package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
  105. package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
  106. package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
  107. package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
  108. package/plugins/specweave-frontend/commands/component-generate.md +510 -0
  109. package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
  110. package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
  111. package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
  112. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
  113. package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
  114. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
  115. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  116. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +212 -0
  117. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  118. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  119. package/plugins/specweave-jira/commands/import-projects.js +183 -0
  120. package/plugins/specweave-jira/commands/import-projects.md +97 -0
  121. package/plugins/specweave-jira/commands/import-projects.ts +288 -0
  122. package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
  123. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  124. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  125. package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
  126. package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
  127. package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
  128. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  129. package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
  130. package/plugins/specweave-mobile/commands/build-config.md +256 -0
  131. package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
  132. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  133. package/plugins/specweave-payments/commands/stripe-setup.md +931 -0
  134. package/plugins/specweave-payments/commands/subscription-flow.md +1193 -0
  135. package/plugins/specweave-payments/commands/subscription-manage.md +386 -0
  136. package/plugins/specweave-payments/commands/webhook-setup.md +295 -0
  137. package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +13 -12
  138. package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
  139. package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
  140. package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
  141. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
  142. package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
  143. package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
  144. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  145. package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
  146. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
  147. package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
  148. package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +818 -0
  149. package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
  150. package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
  151. package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
  152. package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
  153. package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
  154. package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
  155. package/plugins/specweave-testing/commands/test-coverage.md +979 -0
  156. package/plugins/specweave-testing/commands/test-generate.md +1156 -0
  157. package/plugins/specweave-testing/commands/test-init.md +409 -0
  158. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
  159. package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
  160. package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
  161. package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
  162. package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
  163. package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
  164. package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
  165. package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
  166. package/plugins/specweave-ui/commands/ui-automate.md +199 -0
  167. package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
  168. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
  169. package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
  170. package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
  171. package/plugins/specweave/commands/check-hooks.md +0 -257
  172. package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
  173. package/plugins/specweave-plugin-dev/skills/plugin-expert/SKILL.md +0 -1231
  174. /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
@@ -0,0 +1,139 @@
1
+ # Database Migration Generator
2
+
3
+ Generate database migration files for schema changes.
4
+
5
+ ## Task
6
+
7
+ You are an expert database migration specialist. Generate migration files based on the user's requirements.
8
+
9
+ ### Required Information (Ask if not provided):
10
+
11
+ 1. **Migration Type**:
12
+ - Create table
13
+ - Add column(s)
14
+ - Modify column(s)
15
+ - Drop column(s)
16
+ - Add index
17
+ - Add foreign key
18
+ - Seed data
19
+
20
+ 2. **ORM/Tool**:
21
+ - TypeORM (Node.js)
22
+ - Sequelize (Node.js)
23
+ - Alembic (Python)
24
+ - Entity Framework (. NET)
25
+ - Flyway (Java)
26
+ - Raw SQL
27
+
28
+ 3. **Database**: PostgreSQL, MySQL, MongoDB, SQL Server
29
+
30
+ ### Generate Migration:
31
+
32
+ #### 1. **Up Migration** (Apply Changes)
33
+ ```typescript
34
+ // TypeORM example
35
+ export class CreateProductsTable1234567890 implements MigrationInterface {
36
+ public async up(queryRunner: QueryRunner): Promise<void> {
37
+ await queryRunner.createTable(
38
+ new Table({
39
+ name: 'products',
40
+ columns: [
41
+ {
42
+ name: 'id',
43
+ type: 'uuid',
44
+ isPrimary: true,
45
+ default: 'uuid_generate_v4()',
46
+ },
47
+ {
48
+ name: 'name',
49
+ type: 'varchar',
50
+ length: '255',
51
+ isNullable: false,
52
+ },
53
+ {
54
+ name: 'price',
55
+ type: 'decimal',
56
+ precision: 10,
57
+ scale: 2,
58
+ isNullable: false,
59
+ },
60
+ {
61
+ name: 'created_at',
62
+ type: 'timestamp',
63
+ default: 'now()',
64
+ },
65
+ ],
66
+ }),
67
+ true
68
+ );
69
+ }
70
+ }
71
+ ```
72
+
73
+ #### 2. **Down Migration** (Rollback)
74
+ ```typescript
75
+ public async down(queryRunner: QueryRunner): Promise<void> {
76
+ await queryRunner.dropTable('products');
77
+ }
78
+ ```
79
+
80
+ #### 3. **Migration Naming**:
81
+ - Timestamp-based: `1234567890_create_products_table.ts`
82
+ - Descriptive: Clearly state what the migration does
83
+
84
+ #### 4. **Safety Checks**:
85
+ - Check if table/column exists before creating
86
+ - Use transactions for complex migrations
87
+ - Add indexes concurrently (PostgreSQL)
88
+ - Avoid locking production tables
89
+
90
+ #### 5. **Data Migrations**:
91
+ ```typescript
92
+ // Example: Backfill existing data
93
+ await queryRunner.query(`
94
+ UPDATE users
95
+ SET status = 'active'
96
+ WHERE status IS NULL
97
+ `);
98
+ ```
99
+
100
+ ### Best Practices:
101
+
102
+ - **Idempotency**: Migrations should be safe to run multiple times
103
+ - **Atomicity**: Wrap in transactions where possible
104
+ - **Reversibility**: Always provide down migration
105
+ - **Testing**: Test both up and down on staging database
106
+ - **Documentation**: Add comments explaining complex logic
107
+ - **Performance**: Consider impact on large tables
108
+ - **Indexes**: Add indexes for foreign keys
109
+
110
+ ### Common Patterns:
111
+
112
+ 1. **Add Column with Default**:
113
+ ```sql
114
+ ALTER TABLE users
115
+ ADD COLUMN email_verified BOOLEAN DEFAULT FALSE;
116
+ ```
117
+
118
+ 2. **Rename Column** (safe):
119
+ ```sql
120
+ -- Step 1: Add new column
121
+ ALTER TABLE users ADD COLUMN full_name VARCHAR(255);
122
+ -- Step 2: Copy data
123
+ UPDATE users SET full_name = name;
124
+ -- Step 3: Drop old column (after deployment)
125
+ ALTER TABLE users DROP COLUMN name;
126
+ ```
127
+
128
+ 3. **Change Column Type**:
129
+ ```sql
130
+ ALTER TABLE products
131
+ ALTER COLUMN price TYPE NUMERIC(12,2) USING price::numeric(12,2);
132
+ ```
133
+
134
+ ### Example:
135
+
136
+ ```
137
+ User: "Create migration to add email_verified column to users table"
138
+ Result: Complete TypeORM migration with up/down, safe defaults
139
+ ```
@@ -0,0 +1,154 @@
1
+ # Kafka Connect Connector Deployment
2
+
3
+ Deploy and manage Kafka Connect connectors (Source/Sink).
4
+
5
+ ## Task
6
+
7
+ You are an expert in Kafka Connect. Help users deploy source and sink connectors.
8
+
9
+ ### Steps:
10
+
11
+ 1. **Ask for Requirements**:
12
+ - Connector type: Source or Sink
13
+ - Connector class (JDBC, S3, Elasticsearch, etc.)
14
+ - Connection details
15
+ - Topic configuration
16
+
17
+ 2. **Generate Connector Configuration**:
18
+
19
+ #### JDBC Source Connector (PostgreSQL):
20
+ ```json
21
+ {
22
+ "name": "postgres-source-connector",
23
+ "config": {
24
+ "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
25
+ "tasks.max": "1",
26
+ "connection.url": "jdbc:postgresql://localhost:5432/mydb",
27
+ "connection.user": "postgres",
28
+ "connection.password": "${file:/secrets.properties:db-password}",
29
+ "mode": "incrementing",
30
+ "incrementing.column.name": "id",
31
+ "topic.prefix": "postgres-",
32
+ "table.whitelist": "users,orders",
33
+ "poll.interval.ms": "5000",
34
+ "batch.max.rows": "1000",
35
+ "transforms": "createKey,extractInt",
36
+ "transforms.createKey.type": "org.apache.kafka.connect.transforms.ValueToKey",
37
+ "transforms.createKey.fields": "id",
38
+ "transforms.extractInt.type": "org.apache.kafka.connect.transforms.ExtractField$Key",
39
+ "transforms.extractInt.field": "id"
40
+ }
41
+ }
42
+ ```
43
+
44
+ #### Elasticsearch Sink Connector:
45
+ ```json
46
+ {
47
+ "name": "elasticsearch-sink-connector",
48
+ "config": {
49
+ "connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
50
+ "tasks.max": "2",
51
+ "topics": "users,orders",
52
+ "connection.url": "http://elasticsearch:9200",
53
+ "type.name": "_doc",
54
+ "key.ignore": "false",
55
+ "schema.ignore": "true",
56
+ "behavior.on.null.values": "delete",
57
+ "behavior.on.malformed.documents": "warn",
58
+ "max.buffered.records": "20000",
59
+ "batch.size": "2000",
60
+ "linger.ms": "1000",
61
+ "max.in.flight.requests": "5",
62
+ "retry.backoff.ms": "100",
63
+ "max.retries": "10"
64
+ }
65
+ }
66
+ ```
67
+
68
+ #### S3 Sink Connector:
69
+ ```json
70
+ {
71
+ "name": "s3-sink-connector",
72
+ "config": {
73
+ "connector.class": "io.confluent.connect.s3.S3SinkConnector",
74
+ "tasks.max": "3",
75
+ "topics": "events",
76
+ "s3.bucket.name": "my-kafka-bucket",
77
+ "s3.region": "us-east-1",
78
+ "s3.part.size": "5242880",
79
+ "flush.size": "1000",
80
+ "rotate.interval.ms": "3600000",
81
+ "storage.class": "io.confluent.connect.s3.storage.S3Storage",
82
+ "format.class": "io.confluent.connect.s3.format.parquet.ParquetFormat",
83
+ "partitioner.class": "io.confluent.connect.storage.partitioner.TimeBasedPartitioner",
84
+ "partition.duration.ms": "3600000",
85
+ "path.format": "'year'=YYYY/'month'=MM/'day'=dd/'hour'=HH",
86
+ "locale": "en-US",
87
+ "timezone": "UTC"
88
+ }
89
+ }
90
+ ```
91
+
92
+ 3. **Generate Deployment Scripts**:
93
+
94
+ #### Using REST API:
95
+ ```bash
96
+ curl -X POST http://localhost:8083/connectors \
97
+ -H "Content-Type: application/json" \
98
+ -d @connector-config.json
99
+ ```
100
+
101
+ #### Using Confluent CLI:
102
+ ```bash
103
+ confluent connect create \
104
+ --config connector-config.json
105
+ ```
106
+
107
+ #### Check Status:
108
+ ```bash
109
+ curl http://localhost:8083/connectors/postgres-source-connector/status
110
+
111
+ # Expected response:
112
+ {
113
+ "name": "postgres-source-connector",
114
+ "connector": {"state": "RUNNING", "worker_id": "connect:8083"},
115
+ "tasks": [{"id": 0, "state": "RUNNING", "worker_id": "connect:8083"}]
116
+ }
117
+ ```
118
+
119
+ 4. **Generate Monitoring Queries**:
120
+ ```bash
121
+ # List all connectors
122
+ curl http://localhost:8083/connectors
123
+
124
+ # Get connector config
125
+ curl http://localhost:8083/connectors/postgres-source-connector/config
126
+
127
+ # Get connector metrics
128
+ curl http://localhost:8083/connectors/postgres-source-connector/status
129
+
130
+ # Restart connector
131
+ curl -X POST http://localhost:8083/connectors/postgres-source-connector/restart
132
+
133
+ # Pause connector
134
+ curl -X PUT http://localhost:8083/connectors/postgres-source-connector/pause
135
+
136
+ # Resume connector
137
+ curl -X PUT http://localhost:8083/connectors/postgres-source-connector/resume
138
+ ```
139
+
140
+ 5. **Best Practices**:
141
+ - Use secret management for credentials
142
+ - Configure appropriate error handling
143
+ - Set up monitoring and alerting
144
+ - Use SMT (Single Message Transforms) for data transformation
145
+ - Configure dead letter queues
146
+ - Set appropriate batch sizes and flush intervals
147
+ - Use time-based partitioning for sinks
148
+
149
+ ### Example Usage:
150
+
151
+ ```
152
+ User: "Deploy PostgreSQL source connector for users table"
153
+ Result: Complete connector config + deployment scripts
154
+ ```
@@ -0,0 +1,179 @@
1
+ # ksqlDB Query Generator
2
+
3
+ Generate ksqlDB queries for stream processing.
4
+
5
+ ## Task
6
+
7
+ You are a ksqlDB expert. Generate ksqlDB queries for stream processing, aggregations, and joins.
8
+
9
+ ### Steps:
10
+
11
+ 1. **Ask for Requirements**:
12
+ - Query type: Stream, Table, Join, Aggregation
13
+ - Source topics/streams
14
+ - Output requirements
15
+
16
+ 2. **Generate ksqlDB Statements**:
17
+
18
+ #### Create Stream from Topic:
19
+ ```sql
20
+ CREATE STREAM users_stream (
21
+ id VARCHAR KEY,
22
+ email VARCHAR,
23
+ name VARCHAR,
24
+ created_at BIGINT
25
+ ) WITH (
26
+ KAFKA_TOPIC='users',
27
+ VALUE_FORMAT='JSON',
28
+ TIMESTAMP='created_at'
29
+ );
30
+ ```
31
+
32
+ #### Create Table (Materialized View):
33
+ ```sql
34
+ CREATE TABLE user_counts AS
35
+ SELECT
36
+ region,
37
+ COUNT(*) AS user_count,
38
+ COLLECT_LIST(name) AS user_names
39
+ FROM users_stream
40
+ GROUP BY region
41
+ EMIT CHANGES;
42
+ ```
43
+
44
+ #### Stream-Stream Join:
45
+ ```sql
46
+ CREATE STREAM orders_enriched AS
47
+ SELECT
48
+ o.order_id,
49
+ o.product_id,
50
+ o.quantity,
51
+ o.price,
52
+ u.name AS customer_name,
53
+ u.email AS customer_email,
54
+ o.timestamp
55
+ FROM orders_stream o
56
+ INNER JOIN users_stream u
57
+ WITHIN 1 HOUR
58
+ ON o.user_id = u.id
59
+ EMIT CHANGES;
60
+ ```
61
+
62
+ #### Windowed Aggregation:
63
+ ```sql
64
+ -- Tumbling Window (5-minute windows)
65
+ CREATE TABLE sales_by_category_5min AS
66
+ SELECT
67
+ category,
68
+ WINDOWSTART AS window_start,
69
+ WINDOWEND AS window_end,
70
+ COUNT(*) AS order_count,
71
+ SUM(amount) AS total_sales,
72
+ AVG(amount) AS avg_sale,
73
+ MAX(amount) AS max_sale
74
+ FROM orders_stream
75
+ WINDOW TUMBLING (SIZE 5 MINUTES)
76
+ GROUP BY category
77
+ EMIT CHANGES;
78
+
79
+ -- Hopping Window (5-min window, 1-min advance)
80
+ CREATE TABLE sales_hopping AS
81
+ SELECT
82
+ category,
83
+ WINDOWSTART AS window_start,
84
+ COUNT(*) AS order_count
85
+ FROM orders_stream
86
+ WINDOW HOPPING (SIZE 5 MINUTES, ADVANCE BY 1 MINUTE)
87
+ GROUP BY category
88
+ EMIT CHANGES;
89
+
90
+ -- Session Window (inactivity gap = 30 minutes)
91
+ CREATE TABLE user_sessions AS
92
+ SELECT
93
+ user_id,
94
+ WINDOWSTART AS session_start,
95
+ WINDOWEND AS session_end,
96
+ COUNT(*) AS event_count
97
+ FROM user_events_stream
98
+ WINDOW SESSION (30 MINUTES)
99
+ GROUP BY user_id
100
+ EMIT CHANGES;
101
+ ```
102
+
103
+ #### Filtering and Transformation:
104
+ ```sql
105
+ CREATE STREAM high_value_orders AS
106
+ SELECT
107
+ order_id,
108
+ user_id,
109
+ amount,
110
+ UCASE(status) AS status,
111
+ CASE
112
+ WHEN amount > 1000 THEN 'PREMIUM'
113
+ WHEN amount > 500 THEN 'STANDARD'
114
+ ELSE 'BASIC'
115
+ END AS tier
116
+ FROM orders_stream
117
+ WHERE amount > 100
118
+ EMIT CHANGES;
119
+ ```
120
+
121
+ #### Array and Map Operations:
122
+ ```sql
123
+ CREATE STREAM processed_events AS
124
+ SELECT
125
+ id,
126
+ ARRAY_CONTAINS(tags, 'premium') AS is_premium,
127
+ ARRAY_LENGTH(items) AS item_count,
128
+ MAP_KEYS(metadata) AS meta_keys,
129
+ metadata['source'] AS source
130
+ FROM events_stream
131
+ EMIT CHANGES;
132
+ ```
133
+
134
+ 3. **Generate Queries**:
135
+
136
+ ```sql
137
+ -- Push query (continuous)
138
+ SELECT * FROM users_stream
139
+ WHERE region = 'US'
140
+ EMIT CHANGES;
141
+
142
+ -- Pull query (one-time, requires table)
143
+ SELECT * FROM user_counts
144
+ WHERE region = 'US';
145
+ ```
146
+
147
+ 4. **Generate Monitoring Commands**:
148
+
149
+ ```sql
150
+ -- Show streams
151
+ SHOW STREAMS;
152
+
153
+ -- Describe stream
154
+ DESCRIBE users_stream;
155
+
156
+ -- Show queries
157
+ SHOW QUERIES;
158
+
159
+ -- Explain query
160
+ EXPLAIN query_id;
161
+
162
+ -- Terminate query
163
+ TERMINATE query_id;
164
+ ```
165
+
166
+ 5. **Best Practices**:
167
+ - Use appropriate window types for aggregations
168
+ - Set RETENTION for stateful operations
169
+ - Use pull queries for point-in-time lookups
170
+ - Configure partitioning for joins
171
+ - Add error handling for UDFs
172
+ - Monitor query performance
173
+
174
+ ### Example Usage:
175
+
176
+ ```
177
+ User: "Calculate hourly sales by category"
178
+ Result: Complete ksqlDB window aggregation query
179
+ ```
@@ -0,0 +1,123 @@
1
+ # Schema Registry Management
2
+
3
+ Manage Avro/JSON/Protobuf schemas in Confluent Schema Registry.
4
+
5
+ ## Task
6
+
7
+ You are an expert in Confluent Schema Registry. Help users register, update, and manage schemas.
8
+
9
+ ### Steps:
10
+
11
+ 1. **Ask for Required Information**:
12
+ - Schema format: Avro, JSON Schema, or Protobuf
13
+ - Subject name (topic name or custom subject)
14
+ - Schema definition
15
+ - Compatibility mode (optional)
16
+
17
+ 2. **Generate Schema Definition**:
18
+
19
+ #### Avro Example:
20
+ ```json
21
+ {
22
+ "type": "record",
23
+ "name": "User",
24
+ "namespace": "com.example",
25
+ "fields": [
26
+ {"name": "id", "type": "string"},
27
+ {"name": "email", "type": "string"},
28
+ {"name": "createdAt", "type": "long", "logicalType": "timestamp-millis"}
29
+ ]
30
+ }
31
+ ```
32
+
33
+ #### JSON Schema Example:
34
+ ```json
35
+ {
36
+ "$schema": "http://json-schema.org/draft-07/schema#",
37
+ "title": "User",
38
+ "type": "object",
39
+ "properties": {
40
+ "id": {"type": "string"},
41
+ "email": {"type": "string", "format": "email"},
42
+ "createdAt": {"type": "string", "format": "date-time"}
43
+ },
44
+ "required": ["id", "email"]
45
+ }
46
+ ```
47
+
48
+ #### Protobuf Example:
49
+ ```protobuf
50
+ syntax = "proto3";
51
+
52
+ package com.example;
53
+
54
+ message User {
55
+ string id = 1;
56
+ string email = 2;
57
+ int64 created_at = 3;
58
+ }
59
+ ```
60
+
61
+ 3. **Generate Registration Script**:
62
+
63
+ #### Using curl:
64
+ ```bash
65
+ curl -X POST http://localhost:8081/subjects/users-value/versions \
66
+ -H "Content-Type: application/vnd.schemaregistry.v1+json" \
67
+ -d '{
68
+ "schema": "{\"type\":\"record\",\"name\":\"User\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"}]}"
69
+ }'
70
+ ```
71
+
72
+ #### Using Confluent CLI:
73
+ ```bash
74
+ confluent schema-registry schema create \
75
+ --subject users-value \
76
+ --schema schema.avsc \
77
+ --type AVRO
78
+ ```
79
+
80
+ #### Using Python:
81
+ ```python
82
+ from confluent_kafka.schema_registry import SchemaRegistryClient, Schema
83
+
84
+ sr_client = SchemaRegistryClient({'url': 'http://localhost:8081'})
85
+
86
+ schema_str = """
87
+ {
88
+ "type": "record",
89
+ "name": "User",
90
+ "fields": [...]
91
+ }
92
+ """
93
+
94
+ schema = Schema(schema_str, schema_type="AVRO")
95
+ schema_id = sr_client.register_schema("users-value", schema)
96
+ ```
97
+
98
+ 4. **Set Compatibility Mode**:
99
+ ```bash
100
+ # BACKWARD (default) - consumers using new schema can read old data
101
+ # FORWARD - consumers using old schema can read new data
102
+ # FULL - both backward and forward
103
+ # NONE - no compatibility checks
104
+
105
+ curl -X PUT http://localhost:8081/config/users-value \
106
+ -H "Content-Type: application/vnd.schemaregistry.v1+json" \
107
+ -d '{"compatibility": "BACKWARD"}'
108
+ ```
109
+
110
+ 5. **Best Practices**:
111
+ - Use semantic versioning in schema evolution
112
+ - Always test compatibility before registering
113
+ - Document breaking changes
114
+ - Use logical types (timestamp-millis, decimal)
115
+ - Add field descriptions/documentation
116
+ - Use subject naming strategy consistently
117
+
118
+ ### Example Usage:
119
+
120
+ ```
121
+ User: "Register Avro schema for user events"
122
+ Result: Complete Avro schema + registration script
123
+ ```
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "specweave-core",
3
+ "description": "Core software engineering practices including code review, refactoring, architecture design, design patterns, SOLID principles, clean code, technical debt management, and software craftsmanship.",
4
+ "version": "0.24.0",
5
+ "author": {
6
+ "name": "Anton Abyzov",
7
+ "email": "anton.abyzov@gmail.com"
8
+ },
9
+ "homepage": "https://spec-weave.com",
10
+ "repository": "https://github.com/anton-abyzov/specweave",
11
+ "license": "MIT",
12
+ "keywords": [
13
+ "code-review",
14
+ "refactoring",
15
+ "architecture",
16
+ "design-patterns",
17
+ "clean-code",
18
+ "solid",
19
+ "specweave"
20
+ ]
21
+ }