spawnpack 0.1.19 → 0.1.21
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.
- package/package.json +1 -1
- package/templates/AGENTS.md +9 -26
- package/templates/CLAUDE.md +9 -26
package/package.json
CHANGED
package/templates/AGENTS.md
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
## Priorities
|
|
2
|
-
|
|
3
|
-
1. Implement the user's requested behavior completely.
|
|
4
|
-
2. Use the smallest maintainable change that fits existing project patterns.
|
|
5
|
-
3. Verify the changed behavior with the least expensive reliable check.
|
|
6
|
-
4. Preserve unrelated user work and avoid expanding scope.
|
|
7
|
-
|
|
8
|
-
## Scope and execution
|
|
9
|
-
|
|
10
|
-
- Read the relevant source, configuration, references, and callers before editing. For a bug, fix the shared root cause rather than one visible symptom.
|
|
11
|
-
- Act immediately on small, clear tasks. Plan only when the approach is materially ambiguous, architectural, or risky.
|
|
12
|
-
- Ask a question only when repository evidence and documentation cannot resolve choices with meaningfully different outcomes.
|
|
13
|
-
- Do not add unrelated features, refactors, abstractions, dependencies, documentation, or cleanup.
|
|
14
|
-
- Reuse existing helpers and patterns first, then the standard library or platform, then already-installed dependencies.
|
|
15
|
-
- You may suggest a production dependency when it is the smallest suitable solution, but explain why and ask the user before adding it.
|
|
16
|
-
- Keep changes local and migrate every affected caller. Remove obsolete code introduced by the changed path; do not leave compatibility shims unless requested.
|
|
17
|
-
|
|
18
1
|
## Documentation lookup
|
|
19
2
|
|
|
20
3
|
- Before planning or implementing any Minecraft Bedrock change, verify the current relevant documentation. This includes Script API and BP/RP JSON formats, components, events, schemas, MoLang, manifests, commands, animations, and pack behavior.
|
|
@@ -22,6 +5,12 @@
|
|
|
22
5
|
- Prefer current Microsoft Creator documentation and versioned references on `bedrock.dev`. For Script API, also use `https://jaylydev.github.io/scriptapi-docs/latest/`. Use `wiki.bedrock.dev` for established concepts and proven implementation patterns. Confirm stable versus preview status and the target Minecraft version.
|
|
23
6
|
- For other external libraries, frameworks, SDKs, APIs, and CLI tools, verify current official documentation before relying on unfamiliar or version-sensitive behavior.
|
|
24
7
|
|
|
8
|
+
## Technical judgment
|
|
9
|
+
|
|
10
|
+
- Do not assume the user or the agent is correct. Before implementing, verify assumptions against current documentation, repository evidence, established patterns, or a working project sample.
|
|
11
|
+
- If those sources do not resolve a choice that materially affects the result, ask the user for a reference, pattern, or sample project.
|
|
12
|
+
- If evidence shows the requested approach is incorrect, unsafe, incompatible, unnecessarily complex, or slower than a supported alternative, explain why and recommend the better implementation. Follow the user's final choice unless it violates safety or repository constraints.
|
|
13
|
+
|
|
25
14
|
## Verification
|
|
26
15
|
|
|
27
16
|
- After TypeScript changes, run `tsc --noEmit`.
|
|
@@ -31,17 +20,12 @@
|
|
|
31
20
|
|
|
32
21
|
## Code rules
|
|
33
22
|
|
|
34
|
-
- Prefer boring, linear code, guard clauses, explicit state names, and one source of truth.
|
|
35
|
-
- Do not build speculative flexibility. Avoid one-implementation interfaces, factories for one product, and helpers used once unless they materially clarify the code.
|
|
36
|
-
- Preserve input validation, security boundaries, and protections against data loss, duplication, or invalid world state.
|
|
37
23
|
- Do not write comments in code. Use clear naming and straightforward structure so the code is self-explanatory.
|
|
38
24
|
- Validate predictable invalid states before calling an API. Use `try-catch` only for a documented or observed unguardable failure when the catch performs meaningful recovery, cleanup, translation, or contextual rethrow. Keep the `try` block narrow; never silently swallow errors.
|
|
39
|
-
- Avoid repeated allocation, copying, logging, or exception handling in tick handlers and other hot paths.
|
|
40
|
-
- Follow the existing TypeScript configuration and style. Do not introduce unused imports, variables, or exports.
|
|
41
25
|
|
|
42
26
|
## Minecraft Bedrock conventions
|
|
43
27
|
|
|
44
|
-
-
|
|
28
|
+
- Guard before Script API calls that can throw: check `entity.isValid` (players are valid only while loaded) before `getComponent`/`getComponents`; confirm the chunk is loaded before `dimension.getBlock`/`spawnEntity`; and use containers only after re-fetching them from a current block or entity rather than holding a stale reference. Defer world-mutating work from read-only or early-execution callbacks with `system.run`. Reserve `try-catch` for calls whose validity cannot be checked in advance, such as `runCommand` throwing `CommandError`.
|
|
45
29
|
- Prefer `@minecraft/vanilla-data` typed identifiers over raw component, entity, block, item, and effect strings.
|
|
46
30
|
- Check `@minecraft/math` before writing vector, matrix, clamp, lerp, or similar math helpers.
|
|
47
31
|
- Validate changed BP/RP JSON against the project's configured Bedrock schemas when available.
|
|
@@ -49,10 +33,10 @@
|
|
|
49
33
|
|
|
50
34
|
## Performance preferences
|
|
51
35
|
|
|
52
|
-
- Prefer event
|
|
36
|
+
- Before adding `system.runInterval` polling, check the project's Script API version and current documentation for a matching event. Prefer the event when it provides the required data and timing, such as `PlayerInventoryItemChangeAfterEventSignal` instead of repeatedly scanning every player's inventory or hotbar for item changes. Poll only when no suitable event exists or the event cannot represent the required behavior; then minimize the polling frequency, players, slots, and work performed.
|
|
53
37
|
- In hot loops, iterate maps directly with `for (const value of map.values())`. Do not spread maps into temporary arrays or iterate entry pairs when values or keys are enough.
|
|
54
38
|
- Cache stable configuration in memory and persist only when values actually change.
|
|
55
|
-
-
|
|
39
|
+
- Guard invalid states with conditions before they reach the API — unloaded chunks or locations, invalid or despawned entities, etc so Minecraft Bedrock does not throw. Guards are required wherever a state check is possible. Prefer guards over `try-catch`; `try-catch` is allowed only for documented or observed unguardable failures, and must perform meaningful recovery — never rely on it as routine control flow or swallow errors.
|
|
56
40
|
|
|
57
41
|
## Repository hygiene
|
|
58
42
|
|
|
@@ -66,4 +50,3 @@
|
|
|
66
50
|
|
|
67
51
|
- Be direct and concise. State assumptions only when they materially affect the implementation.
|
|
68
52
|
- After changes, report what changed, the verification evidence, and any real blocker or residual risk. Do not add ritual sections for untouched files.
|
|
69
|
-
- Never report completion with known errors in the changed path or imply that a check ran when it did not.
|
package/templates/CLAUDE.md
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
## Priorities
|
|
2
|
-
|
|
3
|
-
1. Implement the user's requested behavior completely.
|
|
4
|
-
2. Use the smallest maintainable change that fits existing project patterns.
|
|
5
|
-
3. Verify the changed behavior with the least expensive reliable check.
|
|
6
|
-
4. Preserve unrelated user work and avoid expanding scope.
|
|
7
|
-
|
|
8
|
-
## Scope and execution
|
|
9
|
-
|
|
10
|
-
- Read the relevant source, configuration, references, and callers before editing. For a bug, fix the shared root cause rather than one visible symptom.
|
|
11
|
-
- Act immediately on small, clear tasks. Plan only when the approach is materially ambiguous, architectural, or risky.
|
|
12
|
-
- Ask a question only when repository evidence and documentation cannot resolve choices with meaningfully different outcomes.
|
|
13
|
-
- Do not add unrelated features, refactors, abstractions, dependencies, documentation, or cleanup.
|
|
14
|
-
- Reuse existing helpers and patterns first, then the standard library or platform, then already-installed dependencies.
|
|
15
|
-
- You may suggest a production dependency when it is the smallest suitable solution, but explain why and ask the user before adding it.
|
|
16
|
-
- Keep changes local and migrate every affected caller. Remove obsolete code introduced by the changed path; do not leave compatibility shims unless requested.
|
|
17
|
-
|
|
18
1
|
## Documentation lookup
|
|
19
2
|
|
|
20
3
|
- Before planning or implementing any Minecraft Bedrock change, verify the current relevant documentation. This includes Script API and BP/RP JSON formats, components, events, schemas, MoLang, manifests, commands, animations, and pack behavior.
|
|
@@ -22,6 +5,12 @@
|
|
|
22
5
|
- Prefer current Microsoft Creator documentation and versioned references on `bedrock.dev`. For Script API, also use `https://jaylydev.github.io/scriptapi-docs/latest/`. Use `wiki.bedrock.dev` for established concepts and proven implementation patterns. Confirm stable versus preview status and the target Minecraft version.
|
|
23
6
|
- For other external libraries, frameworks, SDKs, APIs, and CLI tools, verify current official documentation before relying on unfamiliar or version-sensitive behavior.
|
|
24
7
|
|
|
8
|
+
## Technical judgment
|
|
9
|
+
|
|
10
|
+
- Do not assume the user or the agent is correct. Before implementing, verify assumptions against current documentation, repository evidence, established patterns, or a working project sample.
|
|
11
|
+
- If those sources do not resolve a choice that materially affects the result, ask the user for a reference, pattern, or sample project.
|
|
12
|
+
- If evidence shows the requested approach is incorrect, unsafe, incompatible, unnecessarily complex, or slower than a supported alternative, explain why and recommend the better implementation. Follow the user's final choice unless it violates safety or repository constraints.
|
|
13
|
+
|
|
25
14
|
## Verification
|
|
26
15
|
|
|
27
16
|
- After TypeScript changes, run `tsc --noEmit`.
|
|
@@ -31,17 +20,12 @@
|
|
|
31
20
|
|
|
32
21
|
## Code rules
|
|
33
22
|
|
|
34
|
-
- Prefer boring, linear code, guard clauses, explicit state names, and one source of truth.
|
|
35
|
-
- Do not build speculative flexibility. Avoid one-implementation interfaces, factories for one product, and helpers used once unless they materially clarify the code.
|
|
36
|
-
- Preserve input validation, security boundaries, and protections against data loss, duplication, or invalid world state.
|
|
37
23
|
- Do not write comments in code. Use clear naming and straightforward structure so the code is self-explanatory.
|
|
38
24
|
- Validate predictable invalid states before calling an API. Use `try-catch` only for a documented or observed unguardable failure when the catch performs meaningful recovery, cleanup, translation, or contextual rethrow. Keep the `try` block narrow; never silently swallow errors.
|
|
39
|
-
- Avoid repeated allocation, copying, logging, or exception handling in tick handlers and other hot paths.
|
|
40
|
-
- Follow the existing TypeScript configuration and style. Do not introduce unused imports, variables, or exports.
|
|
41
25
|
|
|
42
26
|
## Minecraft Bedrock conventions
|
|
43
27
|
|
|
44
|
-
-
|
|
28
|
+
- Guard before Script API calls that can throw: check `entity.isValid` (players are valid only while loaded) before `getComponent`/`getComponents`; confirm the chunk is loaded before `dimension.getBlock`/`spawnEntity`; and use containers only after re-fetching them from a current block or entity rather than holding a stale reference. Defer world-mutating work from read-only or early-execution callbacks with `system.run`. Reserve `try-catch` for calls whose validity cannot be checked in advance, such as `runCommand` throwing `CommandError`.
|
|
45
29
|
- Prefer `@minecraft/vanilla-data` typed identifiers over raw component, entity, block, item, and effect strings.
|
|
46
30
|
- Check `@minecraft/math` before writing vector, matrix, clamp, lerp, or similar math helpers.
|
|
47
31
|
- Validate changed BP/RP JSON against the project's configured Bedrock schemas when available.
|
|
@@ -49,10 +33,10 @@
|
|
|
49
33
|
|
|
50
34
|
## Performance preferences
|
|
51
35
|
|
|
52
|
-
- Prefer event
|
|
36
|
+
- Before adding `system.runInterval` polling, check the project's Script API version and current documentation for a matching event. Prefer the event when it provides the required data and timing, such as `PlayerInventoryItemChangeAfterEventSignal` instead of repeatedly scanning every player's inventory or hotbar for item changes. Poll only when no suitable event exists or the event cannot represent the required behavior; then minimize the polling frequency, players, slots, and work performed.
|
|
53
37
|
- In hot loops, iterate maps directly with `for (const value of map.values())`. Do not spread maps into temporary arrays or iterate entry pairs when values or keys are enough.
|
|
54
38
|
- Cache stable configuration in memory and persist only when values actually change.
|
|
55
|
-
-
|
|
39
|
+
- Guard invalid states with conditions before they reach the API — unloaded chunks or locations, invalid or despawned entities, etc so Minecraft Bedrock does not throw. Guards are required wherever a state check is possible. Prefer guards over `try-catch`; `try-catch` is allowed only for documented or observed unguardable failures, and must perform meaningful recovery — never rely on it as routine control flow or swallow errors.
|
|
56
40
|
|
|
57
41
|
## Repository hygiene
|
|
58
42
|
|
|
@@ -66,4 +50,3 @@
|
|
|
66
50
|
|
|
67
51
|
- Be direct and concise. State assumptions only when they materially affect the implementation.
|
|
68
52
|
- After changes, report what changed, the verification evidence, and any real blocker or residual risk. Do not add ritual sections for untouched files.
|
|
69
|
-
- Never report completion with known errors in the changed path or imply that a check ran when it did not.
|