[WIP] Refactor skills module structure to align with shadcn-ui#1129
Merged
[WIP] Refactor skills module structure to align with shadcn-ui#1129
Conversation
9 tasks
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…tructure Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/7c9dbfcd-1ebf-450b-8756-2cd8cc41f5f6 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/7c9dbfcd-1ebf-450b-8756-2cd8cc41f5f6 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the skills/ documentation modules into a shadcn-ui–style layered structure (concise SKILL.md + detailed rules/ + evals/) while keeping each skill independently usable, and deprecates objectstack-hooks by moving its content into objectstack-data.
Changes:
- Added layered
rules/+evals/scaffolding across multiple skills, with new rule documents. - Refactored
objectstack-dataandobjectstack-kernelskills into shorterSKILL.mdfiles that link to detailed rules. - Deprecated
skills/objectstack-hooksand redirected readers toobjectstack-data/rules/hooks.md; updatedCHANGELOG.md.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/objectstack-ui/rules/view-types.md | New UI view-type guidance and examples |
| skills/objectstack-ui/evals/README.md | Placeholder evals structure doc |
| skills/objectstack-quickstart/rules/bootstrap-patterns.md | New project bootstrap guidance/examples |
| skills/objectstack-quickstart/evals/README.md | Placeholder evals structure doc |
| skills/objectstack-kernel/rules/service-registry.md | New kernel DI/service registry guidance |
| skills/objectstack-kernel/rules/plugin-lifecycle.md | New plugin lifecycle guidance |
| skills/objectstack-kernel/rules/hooks-events.md | New kernel hooks/events guidance |
| skills/objectstack-kernel/evals/README.md | Placeholder evals structure doc |
| skills/objectstack-kernel/SKILL.md | Kernel skill condensed + links to rules |
| skills/objectstack-i18n/rules/translation-bundles.md | New i18n bundle guidance |
| skills/objectstack-i18n/evals/README.md | Placeholder evals structure doc |
| skills/objectstack-hooks/SKILL.md | Deprecated + redirected to data hooks docs |
| skills/objectstack-data/rules/*.md | New data rules (naming/relationships/validation/indexing/field-types/hooks) |
| skills/objectstack-data/evals/README.md | Placeholder evals structure doc |
| skills/objectstack-data/SKILL.md | Data skill condensed + links to rules; hooks included |
| skills/objectstack-automation/rules/flow-patterns.md | New automation flow patterns |
| skills/objectstack-automation/evals/README.md | Placeholder evals structure doc |
| skills/objectstack-api/rules/rest-patterns.md | New REST patterns doc |
| skills/objectstack-api/evals/README.md | Placeholder evals structure doc |
| skills/objectstack-ai/rules/agent-patterns.md | New AI agent patterns doc |
| skills/objectstack-ai/evals/README.md | Placeholder evals structure doc |
| CHANGELOG.md | Added Unreleased note describing the skills refactor |
Comment on lines
+26
to
+27
| filters: { status: 'active' }, | ||
| sort: [{ field: 'created_at', order: 'desc' }], |
Comment on lines
+10
to
+14
| GET /api/v1/objects/{object} # List records | ||
| GET /api/v1/objects/{object}/{id} # Get single record | ||
| POST /api/v1/objects/{object} # Create record | ||
| PATCH /api/v1/objects/{object}/{id} # Update record | ||
| DELETE /api/v1/objects/{object}/{id} # Delete record |
Comment on lines
+35
to
+37
| | `SQLiteDriver` | Local development, small deployments | | ||
| | `TursoDriver` | Production (edge database) | | ||
| | `PostgreSQLDriver` | Production (full-featured) | |
Comment on lines
+78
to
+93
| async init(ctx: PluginContext) { | ||
| ctx.hook('analytics:pageview', async (data) => { | ||
| console.log('Page viewed:', data.path); | ||
| }); | ||
| } | ||
| ``` | ||
|
|
||
| ## Hook Handler Patterns | ||
|
|
||
| ### Simple Handler | ||
|
|
||
| ```typescript | ||
| ctx.hook('kernel:ready', async () => { | ||
| console.log('System ready'); | ||
| }); | ||
| ``` |
Comment on lines
+1
to
+19
| --- | ||
| name: objectstack-hooks | ||
| description: > | ||
| Write ObjectStack data lifecycle hooks for third-party plugins and applications. | ||
| Use when implementing business logic, validation, side effects, or data transformations | ||
| during CRUD operations. Covers hook registration, handler patterns, context API, | ||
| error handling, async execution, and integration with the ObjectQL engine. | ||
| license: Apache-2.0 | ||
| compatibility: Requires @objectstack/spec v4+, @objectstack/objectql v4+ | ||
| metadata: | ||
| author: objectstack-ai | ||
| version: "1.0" | ||
| domain: hooks | ||
| tags: hooks, lifecycle, validation, business-logic, side-effects, data-enrichment | ||
| --- | ||
|
|
||
| # Writing Hooks — ObjectStack Data Lifecycle | ||
|
|
||
| Expert instructions for third-party developers to write data lifecycle hooks in ObjectStack. |
Comment on lines
+271
to
+281
| // Engine access | ||
| ql: IDataEngine; // ObjectQL engine instance | ||
| api?: ScopedContext; // Cross-object CRUD API | ||
|
|
||
| // User info shortcut | ||
| user?: { | ||
| id?: string; | ||
| name?: string; | ||
| email?: string; | ||
| }; | ||
| } |
Comment on lines
+37
to
+38
| groupBy: 'stage', | ||
| cardFields: ['name', 'amount', 'close_date'], |
Comment on lines
+230
to
+235
| ### ❌ Incorrect — Duplicate Registration | ||
|
|
||
| ```typescript | ||
| async init(ctx: PluginContext) { | ||
| ctx.registerService('cache', new MemoryCache()); | ||
| ctx.registerService('cache', new RedisCache()); // ❌ Overwrites silently |
Comment on lines
+96
to
+106
| // Register hook handlers | ||
| ctx.hook('kernel:ready', async () => { | ||
| ctx.logger.info('System ready'); | ||
| }); | ||
|
|
||
| // Register data hooks | ||
| ctx.hook('data:beforeInsert', async (objectName, record) => { | ||
| if (objectName === 'task') { | ||
| record.created_at = new Date().toISOString(); | ||
| } | ||
| }); |
Comment on lines
+62
to
+67
| ```typescript | ||
| export default defineStack({ | ||
| manifest: { /* ... */ }, | ||
| driver: new DriverPlugin(new InMemoryDriver()), // ✅ Driver specified | ||
| objects: [/* ... */], | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.