@ibgib/web-gib 0.0.26 → 0.0.28

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 (24) hide show
  1. package/dist/AUTO-GENERATED-version.d.mts +1 -1
  2. package/dist/AUTO-GENERATED-version.mjs +1 -1
  3. package/package.json +1 -1
  4. package/src/AUTO-GENERATED-version.mts +1 -1
  5. package/tools/auto-generated-agent-skills/deprecated-skills.json +14 -0
  6. package/tools/auto-generated-agent-skills/skills/{ibgib-scaffold-app → ibgib-create-app}/SKILL.md +6 -5
  7. package/tools/auto-generated-agent-skills/skills/{ibgib-add-core-engine → ibgib-create-app-core}/SKILL.md +6 -5
  8. package/tools/auto-generated-agent-skills/skills/ibgib-create-app-core/generate-version-file.js +29 -0
  9. package/tools/auto-generated-agent-skills/skills/ibgib-create-app-witness/SKILL.md +2 -8
  10. package/tools/auto-generated-agent-skills/skills/ibgib-create-component/templates/components/component-name/component.mts.template +2 -0
  11. package/tools/auto-generated-agent-skills/skills/ibgib-create-shell/templates/ui/shell/shell-service.mts.template +4 -3
  12. package/tools/auto-generated-agent-skills/skills/ibgib-enum-pattern/SKILL.md +2 -1
  13. package/tools/auto-generated-agent-skills/skills/ibgib-get-pattern/SKILL.md +6 -9
  14. package/tools/auto-generated-agent-skills/skills/ibgib-targeted-refactoring/SKILL.md +3 -3
  15. package/tools/copy-agent-skills.js +7 -0
  16. package/tools/init-agents.js +46 -0
  17. /package/tools/auto-generated-agent-skills/skills/{ibgib-add-core-engine → ibgib-create-app-core}/generate-id.js +0 -0
  18. /package/tools/auto-generated-agent-skills/skills/{ibgib-add-core-engine → ibgib-create-app-core}/templates/bootstrap.mts.template +0 -0
  19. /package/tools/auto-generated-agent-skills/skills/{ibgib-add-core-engine → ibgib-create-app-core}/templates/constants.mts.template +0 -0
  20. /package/tools/auto-generated-agent-skills/skills/{ibgib-add-core-engine → ibgib-create-app-core}/templates/declarations.d.ts.template +0 -0
  21. /package/tools/auto-generated-agent-skills/skills/{ibgib-add-core-engine → ibgib-create-app-core}/templates/helpers.web.mts.template +0 -0
  22. /package/tools/auto-generated-agent-skills/skills/{ibgib-add-core-engine → ibgib-create-app-core}/templates/index.html.template +0 -0
  23. /package/tools/auto-generated-agent-skills/skills/{ibgib-add-core-engine → ibgib-create-app-core}/templates/index.mts.template +0 -0
  24. /package/tools/auto-generated-agent-skills/skills/{ibgib-add-core-engine → ibgib-create-app-core}/templates/types.mts.template +0 -0
@@ -10,5 +10,5 @@
10
10
  /**
11
11
  * this is the version of this package, auto-updated in the build process
12
12
  */
13
- export declare const AUTO_GENERATED_VERSION = "0.0.26";
13
+ export declare const AUTO_GENERATED_VERSION = "0.0.28";
14
14
  //# sourceMappingURL=AUTO-GENERATED-version.d.mts.map
@@ -10,5 +10,5 @@
10
10
  /**
11
11
  * this is the version of this package, auto-updated in the build process
12
12
  */
13
- export const AUTO_GENERATED_VERSION = '0.0.26';
13
+ export const AUTO_GENERATED_VERSION = '0.0.28';
14
14
  //# sourceMappingURL=AUTO-GENERATED-version.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibgib/web-gib",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "description": "Framework for creating agentic ibGib web apps. Contains plumbing for ibgib components, agentic framework (currently only Gemini implemented), web-based IndexedDB storage substrate, and more.",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -11,4 +11,4 @@
11
11
  /**
12
12
  * this is the version of this package, auto-updated in the build process
13
13
  */
14
- export const AUTO_GENERATED_VERSION = '0.0.26';
14
+ export const AUTO_GENERATED_VERSION = '0.0.28';
@@ -0,0 +1,14 @@
1
+ [
2
+ {
3
+ "name": "ibgib-scaffold-app",
4
+ "deprecatedVersion": "0.0.26",
5
+ "deprecatedDate": "2026-04-20",
6
+ "message": "Renamed to ibgib-create-app."
7
+ },
8
+ {
9
+ "name": "ibgib-add-core-engine",
10
+ "deprecatedVersion": "0.0.26",
11
+ "deprecatedDate": "2026-04-20",
12
+ "message": "Renamed to ibgib-create-app-core."
13
+ }
14
+ ]
@@ -1,9 +1,9 @@
1
1
  ---
2
- name: ibgib-scaffold-app
2
+ name: ibgib-create-app
3
3
  description: The master coordinator skill for scaffolding a complete "Hello World" ibgib application. Orchestrates sub-skills for core engine, app witness, and UI shell.
4
4
  ---
5
5
 
6
- # ibgib-scaffold-app
6
+ # ibgib-create-app
7
7
 
8
8
  This is a Meta-Skill that coordinates multiple sub-skills to create a functional, buildable ibgib application from scratch (Greenfield) or to add ibgib to an existing project (Brownfield).
9
9
 
@@ -12,10 +12,11 @@ To orchestrate the modular sub-skills so the final application is type-safe, bui
12
12
 
13
13
  ## Sub-Skills
14
14
  This coordinator uses:
15
- 1. `ibgib-add-core-engine`: FOUNDATION (Bootstrap, Global State, Types).
15
+ 1. `ibgib-create-app-core`: FOUNDATION (Bootstrap, Global State, Types).
16
16
  2. `ibgib-create-app-witness`: LOGIC (App Witness class, commands, helpers).
17
17
  3. `ibgib-create-shell`: UI (Shell service, event handlers).
18
18
  4. `ibgib-create-component`: COMPONENT (Initial main app component - optional but recommended).
19
+ * _Note: You can simple create a plain-vanilla shell that is not encapsulated in an ibgib component, but you will be losing all of the plumbing associated with a backing ibgib which makes this the recommended pattern._
19
20
 
20
21
  ## Parameters (Shared State)
21
22
  The agent must generate and maintain these tokens across sub-skill executions:
@@ -29,11 +30,11 @@ The agent must generate and maintain these tokens across sub-skill executions:
29
30
 
30
31
  ## Workflow for Greenfield (Fresh App)
31
32
  1. **Prepare Tokens**: Generate/confirm all tokens. Generate UUIDs for IDs in templates.
32
- 2. **Core Engine**: Call `ibgib-add-core-engine` to scaffold the 7 foundational files.
33
+ 2. **Core Engine**: Call `ibgib-create-app-core` to scaffold the 7 foundational files.
33
34
  3. **App Witness**: Call `ibgib-create-app-witness` to scaffold the witness logic.
34
35
  4. **UI Shell**: Call `ibgib-create-shell` to scaffold the shell service.
35
36
  5. **Main Component**: Call `ibgib-create-component` to create the initial app component.
36
- 6. **Hook Up**:
37
+ 6. **Hook Up**:
37
38
  - Update `bootstrap.mts` to use the shell service and register the component.
38
39
  - Create `package.json` and `tsconfig.json` (if in a new directory).
39
40
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: ibgib-add-core-engine
2
+ name: ibgib-create-app-core
3
3
  description: >
4
4
  Scaffolds the foundational ibgib bootstrap flow and global state management.
5
5
  Generates the 7 foundational files (index.html, index.mts, bootstrap.mts,
@@ -7,7 +7,7 @@ description: >
7
7
  ibgib app to boot. Supports both greenfield and brownfield projects.
8
8
  ---
9
9
 
10
- # Skill: ibgib-add-core-engine
10
+ # Skill: ibgib-create-app-core
11
11
 
12
12
  ## What This Skill Does
13
13
 
@@ -17,7 +17,7 @@ Generates the engineering foundation for an ibgib app. This includes:
17
17
  - **Storage**: Initializing IndexedDB spaces.
18
18
  - **Types & Helpers**: Providing the basic framework for identity and witness coordination.
19
19
 
20
- This skill is often the first step in creating a new app, or used to "ibgib-ify" an existing project. It does NOT generate the App Witness (the business logic) or the UI Shell; use `ibgib-create-app-witness` and `ibgib-create-shell` for those.
20
+ This skill is often the first step in creating a new app, or used to "ibgib-ify" an existing project. It does this by bootstrapping the environment/storage so that global state, the "metaspace" and the default concrete local user space (backed by IndexedDB). It does NOT generate the App Witness (the business logic) or the UI Shell; use `ibgib-create-app-witness` and `ibgib-create-shell` for those.
21
21
 
22
22
  ---
23
23
 
@@ -27,7 +27,8 @@ This skill is often the first step in creating a new app, or used to "ibgib-ify"
27
27
  2. Verify that `@ibgib/ts-gib`, `@ibgib/helper-gib`, `@ibgib/core-gib`, and
28
28
  `@ibgib/web-gib` are available in the workspace.
29
29
  3. Confirm the project has an `AUTO-GENERATED-version.mts` file, or note that
30
- one is needed.
30
+ one is needed. Create the `generate-version-file.js` if needed and incorporate in the prebuild script.
31
+ * the source for this that you can copy is at `.agents/skills/ibgib-create-app-core/generate-version-file.js`
31
32
 
32
33
  ---
33
34
 
@@ -52,7 +53,7 @@ This skill is often the first step in creating a new app, or used to "ibgib-ify"
52
53
  Derive tokens from the developer's answers. Generate a fresh `{{APP_UUID}}` using:
53
54
 
54
55
  ```bash
55
- node .agents/skills/ibgib-add-core-engine/generate-id.js
56
+ node .agents/skills/ibgib-create-app-core/generate-id.js
56
57
  ```
57
58
 
58
59
  ### 2. Generate all files
@@ -0,0 +1,29 @@
1
+
2
+ import * as pathUtils from 'path';
3
+ import { writeFile } from 'node:fs/promises';
4
+
5
+ import packageJson from '../package.json' with {type: 'json'};
6
+
7
+ const lc = `[${import.meta.url}]`;
8
+ console.log(`${lc} starting... (I: genuuid)`)
9
+
10
+ const filePath = pathUtils.resolve('./src/AUTO-GENERATED-version.mts')
11
+
12
+ const contents = `/**
13
+ * @module auto-generated-version
14
+ *
15
+ * CHANGES TO THIS FILE NOT BE SAVED
16
+ *
17
+ * this is automatically updated in the build process.
18
+ *
19
+ * CHANGES TO THIS FILE NOT BE SAVED
20
+ */
21
+
22
+ /**
23
+ * this is the version of this package, auto-updated in the build process
24
+ */
25
+ export const AUTO_GENERATED_VERSION = '${packageJson.version}';
26
+ `;
27
+
28
+ await writeFile(filePath, contents, { encoding: 'utf8' });
29
+ console.log(`${lc} complete.`)
@@ -10,7 +10,7 @@ description: >
10
10
 
11
11
  ## What This Skill Does
12
12
 
13
- Generates the "Brain" of an ibgib app. In ibgib architecture, the App Witness is a class that reacts to "Request Comments" (commands) sent by the user or-other agents.
13
+ An ibgib alone is a data description. A "witness" is a class that provides behavior that wraps this ibgib data shape via a single function with the following basic shape: `witness(arg: IbGib_V1): Promise<IbGib_V1>`. So a witness provides a single binding point that takes in an ibgib and returns one. This skill generates the "Brain" of an ibgib app that implements this interface. Concretely, the generated app witness class is one that adds plumbing for parsing incoming comments (commands) sent by the user or-other agents. A web app defaults to a single configuration/comment (`--interactive`), but this can be extended to have features enabled/disabled per context.
14
14
 
15
15
  This skill scaffolds:
16
16
  - **App Class**: Inherits from `AppBase_V1` and handles the initial `--interactive` request to boot the app.
@@ -36,7 +36,7 @@ This skill scaffolds:
36
36
  ## Generation Steps
37
37
 
38
38
  ### 1. Confirm Tokens
39
- Ensure you have the same tokens used in `ibgib-add-core-engine`.
39
+ Ensure you have the same tokens used in `ibgib-create-app-core`.
40
40
 
41
41
  ### 2. Generate Files
42
42
  Apply substitutions to templates and write to the target directory (usually `src/`).
@@ -51,9 +51,3 @@ Apply substitutions to templates and write to the target directory (usually `src
51
51
 
52
52
  ### 3. Replace `genuuid` placeholders
53
53
  Replace all `genuuid` strings in the templates with fresh IDs from `generate-id.js`.
54
-
55
- ---
56
-
57
- ## Reference Implementations
58
- - `apps/learning/src/witness/app/pulmoniq-learning/` — Historical reference for full-featured witnesses.
59
- - `apps/website/src/witness/app/pulmoniq-website/` — Historical reference for shell-service witnesses.
@@ -90,6 +90,8 @@ export class {{COMPONENT_CLASS_PREFIX}}ComponentInstance
90
90
  if (!this.elements) { throw new Error(`(UNEXPECTED) this.elements falsy? (E: genuuid)`); }
91
91
 
92
92
  // Map shadow root elements
93
+ // todo: complete this line. contentEl is required in ElementsBase
94
+ // this.elements.contentEl =
93
95
  this.elements.containerEl = this.shadowRoot!.getElementById('container') as HTMLDivElement;
94
96
  this.elements.titleEl = this.shadowRoot!.getElementById('title') as HTMLHeadingElement;
95
97
 
@@ -21,7 +21,7 @@ export class {{APP_CLASSNAME_PREFIX}}ShellService {
21
21
  private shellContainer: HTMLElement | null = null;
22
22
 
23
23
  /**
24
- * Promise that resolves when the shell service has completed its
24
+ * Promise that resolves when the shell service has completed its
25
25
  * asynchronous initialization (e.g. component registration).
26
26
  */
27
27
  public initialized: Promise<void>;
@@ -46,8 +46,9 @@ export class {{APP_CLASSNAME_PREFIX}}ShellService {
46
46
  const lc = `${this.lc}[${this.registerComponents.name}]`;
47
47
  try {
48
48
  const componentsMeta: IbGibDynamicComponentMeta[] = [
49
- // Add your component metas here, e.g.:
49
+ // Add your individual component metas or sets here, e.g.:
50
50
  // new MyAwesomeComponentMeta(),
51
+ // ...MyAwesomeComponentsSet,
51
52
  ];
52
53
  const componentSvc = await getComponentSvc();
53
54
  for (let componentMeta of componentsMeta) {
@@ -123,7 +124,7 @@ export class {{APP_CLASSNAME_PREFIX}}ShellService {
123
124
  }
124
125
 
125
126
  /**
126
- * Returns the singleton instance of the Shell Service, initializing it on
127
+ * Returns the singleton instance of the Shell Service, initializing it on
127
128
  * globalThis if necessary.
128
129
  */
129
130
  export function get{{APP_CLASSNAME_PREFIX}}ShellSvc(): {{APP_CLASSNAME_PREFIX}}ShellService {
@@ -1,5 +1,6 @@
1
1
  ---
2
- description: TypeScript enum pattern used in this codebase
2
+ name: ibgib-enum-pattern
3
+ description: more robust and powerful enum pattern used in this codebase
3
4
  ---
4
5
 
5
6
  # Ibgib Enum Pattern Skill
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: ibgib-get-pattern
2
3
  description: Patterns for robustly getting IbGibs from spaces
3
4
  ---
4
5
 
@@ -18,7 +19,7 @@ Always wrap retrieval logic in a `try..catch..finally` block to ensure errors ar
18
19
  const lc = `[${myFunctionName.name}]`;
19
20
  try {
20
21
  if (logalot) { console.log(`${lc} starting... (I: genuuid)`); }
21
-
22
+
22
23
  // ... retrieval logic ...
23
24
 
24
25
  } catch (error) {
@@ -38,8 +39,8 @@ Use this when you have access to a `MetaspaceService` (It is often appropriate t
38
39
  ```typescript
39
40
  // Ensure space is provided or fallback to local user space
40
41
  space ??= await metaspace.getLocalUserSpace({ lock: false });
41
- if (!space) {
42
- throw new Error(`(UNEXPECTED) space falsy and we couldn't get default local user space from metaspace? (E: genuuid)`);
42
+ if (!space) {
43
+ throw new Error(`(UNEXPECTED) space falsy and we couldn't get default local user space from metaspace? (E: genuuid)`);
43
44
  }
44
45
 
45
46
  const resGet = await metaspace.get({ addrs, space });
@@ -70,8 +71,8 @@ if (resGet.success && resGet.ibGibs?.length === addrs.length) {
70
71
  } else {
71
72
  // Examine rawResultIbGib for more context
72
73
  const resIbGib = resGet.rawResultIbGib as IbGibSpaceResultIbGib<IbGib_V1, IbGibSpaceResultData, IbGibSpaceResultRel8ns>;
73
- if (!resIbGib?.data) {
74
- throw new Error(`(UNEXPECTED) resGet.rawResultIbGib.data falsy? (E: genuuid)`);
74
+ if (!resIbGib?.data) {
75
+ throw new Error(`(UNEXPECTED) resGet.rawResultIbGib.data falsy? (E: genuuid)`);
75
76
  }
76
77
  throw new Error(`(UNEXPECTED) couldn't find addrs? addrsNotFound: ${resIbGib.data.addrsNotFound}? space.ib: ${space.ib} (E: genuuid)`);
77
78
  }
@@ -86,7 +87,3 @@ if (resGet.success && resGet.ibGibs?.length === addrs.length) {
86
87
  | **Result Validation** | Always check `resGet.success` AND that the returned `ibGibs` array matches the expected length. |
87
88
  | **Debugging Context** | When a fetch fails, cast `resGet.rawResultIbGib` to `IbGibSpaceResultIbGib` and include `addrsNotFound` in the error message. |
88
89
  | **Space Fallback** | When using `metaspace`, consider falling back to `metaspace.getLocalUserSpace({ lock: false })` if no space is provided. |
89
-
90
- ## Real-World Example
91
-
92
- See `apps/learning/src/common/parse/parse-helper.mts` -> `fetchLayer` for the reference implementation of this pattern.
@@ -1,9 +1,9 @@
1
1
  ---
2
- name: Ibgib Targeted Refactoring
2
+ name: ibgib-targeted-refactoring
3
3
  description: Refactor a file to conform to specified style guidelines, using a metadata file to track user-selected rules and code changes.
4
4
  ---
5
5
 
6
- # Ibgib Targeted Refactoring
6
+ # ibgib-targeted-refactoring
7
7
 
8
8
  This skill guides the agent to refactor a target file using guidelines from a specified styleguide. The process relies on an intermediate review step where the user can pick exactly which guidelines to apply.
9
9
 
@@ -51,7 +51,7 @@ etc...
51
51
  3. Read the target file.
52
52
  4. **Apply only the remaining rules** to the target file. (If there is a helper script provided along with this skill, use it as instructed in the specific user prompt).
53
53
  5. **CRITICAL LOGGING RULE**: If any of the remaining rules involve tagging log messages, warnings, or errors (e.g., as specified by `STYLEGUIDE.md`: "* Tag ALL logging messages, warnings, and errors with the proper prefix, a uuid or 'genuuid', inside parens*"), you MUST run the provided custom script to generate actual IDs.
54
- * Run the command: `node .agent/skills/targeted_refactoring/generate-id.js`
54
+ * Run the command: `node .agents/skills/ibgib-targeted-refactoring/generate-id.js`
55
55
  * This will output a list of 10 unique IDs ending in the current year.
56
56
  * Use these generated IDs to replace any placeholder `(genuuid)` strings in your newly refactored code (or anywhere you had to add a new tag). If you run out of IDs, just run the command again. Do NOT just insert the literal string `"genuuid"` in the final code.
57
57
 
@@ -22,6 +22,13 @@ try {
22
22
  if (fs.existsSync(targetAgentsDir)) {
23
23
  fs.rmSync(targetAgentsDir, { recursive: true, force: true });
24
24
  }
25
+ fs.mkdirSync(targetAgentsDir, { recursive: true });
26
+
27
+ // Copy deprecated-skills.json if it exists
28
+ const deprecatedFileSrc = path.join(sourceAgentsDir, 'deprecated-skills.json');
29
+ if (fs.existsSync(deprecatedFileSrc)) {
30
+ fs.cpSync(deprecatedFileSrc, path.join(targetAgentsDir, 'deprecated-skills.json'));
31
+ }
25
32
 
26
33
  // We only want to copy skills that start with "ibgib-"
27
34
  const sourceSkillsDir = path.join(sourceAgentsDir, 'skills');
@@ -71,6 +71,52 @@ try {
71
71
  console.log(`${logPref} ✅ Copied skill: ${skillName}`);
72
72
  }
73
73
  }
74
+
75
+ // Check for deprecated skills in the user's workspace
76
+ const deprecatedFilePath = path.join(sourceAgentsDir, 'deprecated-skills.json');
77
+ if (fs.existsSync(deprecatedFilePath)) {
78
+ try {
79
+ const deprecatedList = JSON.parse(fs.readFileSync(deprecatedFilePath, 'utf8'));
80
+
81
+ if (deprecatedList && Array.isArray(deprecatedList) && deprecatedList.length > 0) {
82
+ let mostRecentDate = '';
83
+ for (const d of deprecatedList) {
84
+ if (d.deprecatedDate && d.deprecatedDate > mostRecentDate) {
85
+ mostRecentDate = d.deprecatedDate;
86
+ }
87
+ }
88
+ const dateNote = mostRecentDate ? ` (most recently on ${mostRecentDate})` : '';
89
+ console.log(`\n${logPref} ℹ️ Notice: Some skills have been deprecated by ibGib${dateNote}. See deprecated-skills.json for details.`);
90
+ }
91
+
92
+ const userSkills = fs.readdirSync(targetSkillsDir, { withFileTypes: true });
93
+ let foundDeprecated = false;
94
+
95
+ for (const dirent of userSkills) {
96
+ if (!dirent.isDirectory()) continue;
97
+ const skillName = dirent.name;
98
+ const deprecated = deprecatedList.find(d => d.name === skillName);
99
+
100
+ if (deprecated) {
101
+ if (!foundDeprecated) {
102
+ console.log(`\n${logPref} ⚠️ WARNING: DEPRECATED SKILLS DETECTED IN YOUR WORKSPACE ⚠️`);
103
+ console.log(`${logPref} The following skills in your ${targetSkillsDir} folder are deprecated:`);
104
+ foundDeprecated = true;
105
+ }
106
+ const versionString = deprecated.deprecatedVersion ? ` (v${deprecated.deprecatedVersion})` : '';
107
+ const dateString = deprecated.deprecatedDate ? ` [${deprecated.deprecatedDate}]` : '';
108
+ const msgString = deprecated.message ? ` - ${deprecated.message}` : '';
109
+ console.log(`${logPref} * ${skillName}${versionString}${dateString}${msgString}`);
110
+ }
111
+ }
112
+ if (foundDeprecated) {
113
+ console.log(`${logPref} Note: Deprecated skills are NOT auto-deleted. You may safely remove them manually.\n`);
114
+ }
115
+ } catch (e) {
116
+ console.error(`${logPref} Error reading deprecated skills list:`, e);
117
+ }
118
+ }
119
+
74
120
  console.log(`${logPref} Finished initializing agent skills.`);
75
121
  } catch (error) {
76
122
  console.error(`${logPref} ❌ Failed to copy agent skills:`, error);