一键导入
remove-sql-fields
TRIGGER when user asks to remove, drop, or delete fields, properties, or columns from a SQL CRUD microservice's object.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
TRIGGER when user asks to remove, drop, or delete fields, properties, or columns from a SQL CRUD microservice's object.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | remove-sql-fields |
| description | TRIGGER when user asks to remove, drop, or delete fields, properties, or columns from a SQL CRUD microservice's object. |
CRITICAL: Read and analyze this microservice before starting. Do NOT explore or analyze other microservices unless explicitly instructed to do so. The instructions in this skill are self-contained to this microservice.
IMPORTANT: MyNoun, MyNounKey, mynoun, and mynounapi are placeholders for the actual object, its key, directory, and API package of the microservice.
Copy this checklist and track your progress:
Removing fields of the object:
- [ ] Step 1: Read Local CLAUDE.md File
- [ ] Step 2: Update the Type Definition of the Object
- [ ] Step 3: Update the Type Definition of the Query
- [ ] Step 4: Update Database Schema
- [ ] Step 5: Remove Mappings of Column Names to Object Fields
- [ ] Step 6: Remove Query Conditions
- [ ] Step 7: Update Integration Tests
- [ ] Step 8: Housekeeping
CLAUDE.md FileRead the local CLAUDE.md file in the microservice's directory. It contains microservice-specific instructions that should take precedence over global instructions.
Find the type definition of the object in mynounapi/object.go.
Remove the appropriate fields from the type definition of the struct.
Remove the irrelevant code from the object's Validate method.
Clean up any unused imports.
Find the type definition of the query in mynounapi/query.go.
Remove the appropriate fields from the type definition of the struct.
Remove the irrelevant code from the query's Validate method.
Clean up any unused imports.
Create a new migration script file in resources/sql with an incremental file name. IMPORTANT: Do not edit an existing migration file.
Refer to the older .sql migration files to identify what if any constraints were associated with the deprecated columns. Use ALTER TABLE statements to drop these constraints, if applicable.
-- DRIVER: mysql
ALTER TABLE my_table DROP CONSTRAINT my_table_constraint_name;
-- DRIVER: pgx
ALTER TABLE my_table DROP CONSTRAINT my_table_constraint_name;
-- DRIVER: mssql
ALTER TABLE my_table DROP CONSTRAINT my_table_constraint_name;
Refer to the older .sql migration files to identify what if any indices were associated with the deprecated columns. Use DROP INDEX statements to drop these indices, if applicable.
-- DRIVER: mysql
DROP INDEX my_table_idx_deprecated_field ON my_table;
-- DRIVER: pgx
DROP INDEX my_table_idx_deprecated_field;
-- DRIVER: mssql
DROP INDEX my_table_idx_deprecated_field ON my_table;
Append ALTER TABLE statements to drop the columns.
-- DRIVER: mysql
ALTER TABLE my_table
DROP COLUMN deprecated_field,
DROP COLUMN unused_field;
-- DRIVER: pgx
ALTER TABLE my_table
DROP COLUMN deprecated_field,
DROP COLUMN unused_field;
-- DRIVER: mssql
ALTER TABLE my_table DROP COLUMN
deprecated_field,
unused_field;
-- DRIVER: sqlite
ALTER TABLE my_table DROP COLUMN deprecated_field;
-- DRIVER: sqlite
ALTER TABLE my_table DROP COLUMN unused_field;
IMPORTANT: SQLite only supports dropping one column per ALTER TABLE statement. Each column must be a separate statement prefixed with -- DRIVER: sqlite.
Update the mappings of the database column names to their corresponding object fields in mapColumnsOnInsert, mapColumnsOnUpdate and mapColumnsOnSelect in service.go. Remove mappings of deprecated columns to deprecated object fields.
Remove the query conditions and searchable columns in prepareWhereClauses in service.go that correspond to the removed fields or columns.
Remove references to the deprecated fields in service_test.go, including in the NewObject constructor and TestMyNoun_ColumnMappings.
Remove references to the deprecated fields in mynounapi/object_test.go and mynounapi/query_test.go.
Follow the housekeeping skill. Removing fields changes only the hand-written domain code (object.go, query.go, service.go, resources/sql), not definition.go, so the boilerplate regeneration is a no-op; the Version bump and go vet still apply.
TRIGGER when the user asks to upgrade the project to a newer or the latest version of Microbus, or to update the framework. Each Microbus release ships this one self-contained skill; it applies that release's single-version migration, then chains to the next release's copy of this skill until the target version is reached.
TRIGGER when user asks to create, scaffold, or initialize a new microservice.
How to choose the hostname of a new Microbus microservice. Referenced by the add-microservice and add-sql-microservice scaffolding skills (and, through their delegation to add-microservice, by add-python-microservice and import-openapi-microservice). Consult it whenever a microservice's hostname is being chosen.
Performs an architectural review of a microservice-based system built on the Microbus framework. Covers only cross-cutting, cross-microservice concerns - service boundaries, the dependency graph, coupling, cross-service consistency, data ownership, workflow composition, edge security, and system operations. Anything judgeable inside a single microservice directory belongs to the review-microservice skill and is out of scope here. Produces a structured report with findings and recommendations.
Reviews the microservices touched by a set of changes - by default the whole current feature branch versus its merge-base with main, plus any uncommitted work. Runs the review-microservice skill on each changed microservice and the review-architecture skill scoped to those microservices and their graph neighbors, then consolidates one report. Use before merging a branch or before committing working-tree changes.
Performs a thorough review of a single Microbus microservice. Checks for completeness, framework compliance, code quality, security, test coverage, documentation, API design, and data access performance. Produces a structured report with findings and recommendations.