Skip to content

Add skill scaffolding guide and entity/localization system docs#199

Merged
DiamondDagger590 merged 1 commit into
recodefrom
claude/improve-ai-agent-context-Nc1Of
Mar 4, 2026
Merged

Add skill scaffolding guide and entity/localization system docs#199
DiamondDagger590 merged 1 commit into
recodefrom
claude/improve-ai-agent-context-Nc1Of

Conversation

@DiamondDagger590
Copy link
Copy Markdown
Owner

@DiamondDagger590 DiamondDagger590 commented Mar 4, 2026

Summary

This PR adds comprehensive developer documentation for the McRPG codebase, including a step-by-step skill scaffolding command and detailed system documentation for the entity hierarchy and localization system.

Key Changes

  • .claude/commands/add-skill.md — New 11-step command guide for scaffolding a complete McRPG skill end-to-end, from gathering inputs through final verification. Includes code templates for config files, components, skill classes, and registration points.

  • .cursor/rules/entity-system.mdc — New Cursor rules document covering the McRPG entity and holder hierarchy (AbilityHolderLoadoutHolderSkillHolder), how McRPGPlayer composes these holders, retrieval patterns via EntityManager and PlayerManager, key responsibilities of each holder type, and anti-patterns to avoid.

  • CLAUDE.md — Enhanced with:

    • New "Localization System" section documenting the locale chain, BundledLocale vs. DynamicLocale, how to add new locale keys, and message resolution patterns
    • Updated "Keeping This File Current" checklist to include entity hierarchy changes, localization system changes, and new locale key sections

Implementation Details

  • The skill scaffolding guide references the Swords skill as the canonical reference implementation and provides concrete code templates for each step
  • Entity system documentation clarifies the composition pattern used by McRPGPlayer and emphasizes type-narrowing best practices to avoid unnecessary casts
  • Localization documentation explains the fallback chain and distinguishes between bundled (JAR-shipped) and dynamic (runtime-discovered) locale sources
  • All documentation includes file paths and cross-references to enable quick navigation

https://claude.ai/code/session_01A9C5oe6ZEHpfYop6k29mkN

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for skill development, including step-by-step workflows and code templates for system extension.
    • Introduced documentation describing entity system architecture, component relationships, and holder hierarchies.
    • Enhanced localization system documentation with configuration and registration procedures.

…ation docs

- .claude/commands/add-skill.md: /add-skill slash command with a 10-step
  checklist covering ConfigFile creation, FileType registration, YAML
  resource, LevelableComponent, skill class, LocalizationKey route,
  locale YAML entry, McRPGExpansion registration, and final verification —
  mirrors the depth of /add-ability for skill authoring

- .cursor/rules/entity-system.mdc: new glob-targeted rule for
  entity/**/*.java and holder/**/*.java covering the full holder hierarchy
  (AbilityHolder → LoadoutHolder → SkillHolder, with McRPGPlayer as a
  composition), when to type to each level, EntityManager retrieval
  patterns, McRPGPlayer retrieval via PlayerManager, and anti-patterns
  around cross-tick holder references

- CLAUDE.md: add Localization System section documenting
  McRPGLocalizationManager locale chain resolution order, BundledLocale
  vs DynamicLocale, LocalizationKey route constant conventions, how to
  send localized messages, and the rule against direct MiniMessage sends;
  update Keeping This File Current maintenance table with entity hierarchy
  and localization change triggers

https://claude.ai/code/session_01A9C5oe6ZEHpfYop6k29mkN
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 4, 2026

Walkthrough

Three new documentation files introduced to guide McRPG development: skill scaffolding workflow (steps 0-11 with code templates and file paths), entity and holder system architecture including retrieval patterns and lifecycle rules, and localization system implementation covering locale resolution, registration, and messaging methods.

Changes

Cohort / File(s) Summary
McRPG Documentation
.claude/commands/add-skill.md, .cursor/rules/entity-system.mdc, CLAUDE.md
Added comprehensive documentation covering skill scaffolding workflow with step-by-step instructions and code templates, entity/holder system hierarchy and composition patterns, and localization system implementation including locale resolution order, source types, and messaging methods. Updated CLAUDE.md keepalive rules to signal documentation maintenance triggers.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the pull request's main changes: adding a skill scaffolding guide and documentation for entity and localization systems.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/improve-ai-agent-context-Nc1Of

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/commands/add-skill.md:
- Around line 253-261: The fenced command blocks in
.claude/commands/add-skill.md (the blocks containing "./gradlew compileJava" and
"./gradlew test") lack language specifiers; update each triple-backtick fence to
include a shell language tag (e.g., ```shell or ```bash) so the blocks become
```shell ./gradlew compileJava ``` and ```shell ./gradlew test ``` for proper
syntax highlighting.
- Around line 215-224: Fix the markdown in Step 7 by ensuring proper blank lines
and correct ordered list numbering around the code blocks: add a blank line
before the first java code block that demonstrates creating the header constant
(referencing the pattern using SKILLS_HEADER, toRoutePath and the
<NAME_UPPER>_HEADER symbol), restart the numbering for the next sub-item as "1."
and add a blank line after the second java code block that shows the
display-item Route (referencing <NAME_UPPER>_DISPLAY_ITEM and Route.fromString).
Ensure both code fences are separated from text by blank lines so the markdown
renders correctly.

In `@CLAUDE.md`:
- Around line 386-399: Fix the markdown in the "Adding a New Locale Key"
section: ensure there is a blank line after the code fence that contains
mcRPGLocalizationManager.registerLanguageFile(myMcRPGLocalization); and add a
blank line before the "### Adding a New Locale Key" header; wrap the Java
snippet beginning with the LocalizationKey example (references: toRoutePath,
MY_SECTION_HEADER, MY_NEW_KEY, Route) in proper triple-backtick fences with a
blank line after the opening fence and before the closing fence; finally restart
the ordered list numbering so the list items under the code sample start at 1
(i.e., change the two trailing items to "1.") so the ordered list displays
correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 16ddd918-ead6-4994-b571-1af54c0f0f02

📥 Commits

Reviewing files that changed from the base of the PR and between ea5b9c8 and 83920eb.

📒 Files selected for processing (3)
  • .claude/commands/add-skill.md
  • .cursor/rules/entity-system.mdc
  • CLAUDE.md

Comment on lines +215 to +224
1. Add a skill header constant (following the existing pattern, e.g. `SWORDS_HEADER`):
```java
private static final String <NAME_UPPER>_HEADER = toRoutePath(SKILLS_HEADER, "<name_key>");
```

2. Add the display item route:
```java
public static final Route <NAME_UPPER>_DISPLAY_ITEM = Route.fromString(toRoutePath(<NAME_UPPER>_HEADER, "display-item"));
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix markdown formatting in Step 7.

The ordered list numbering and code block spacing violate markdown conventions:

  • Missing blank line before the first code block
  • The second list item should be numbered 1. (lists restart within each step context)
  • Missing blank line after the second code block
📝 Proposed formatting fix
 In `src/main/java/us/eunoians/mcrpg/configuration/file/localization/LocalizationKey.java`:
 
-1. Add a skill header constant (following the existing pattern, e.g. `SWORDS_HEADER`):
+1. Add a skill header constant (following the existing pattern, e.g. `SWORDS_HEADER`):
+
 ```java
 private static final String <NAME_UPPER>_HEADER = toRoutePath(SKILLS_HEADER, "<name_key>");

-2. Add the display item route:
+1. Add the display item route:
+

public static final Route <NAME_UPPER>_DISPLAY_ITEM = Route.fromString(toRoutePath(<NAME_UPPER>_HEADER, "display-item"));
</details>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.21.0)</summary>

[warning] 216-216: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

[warning] 220-220: Ordered list item prefix
Expected: 1; Actual: 2; Style: 1/1/1

(MD029, ol-prefix)

---

[warning] 221-221: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @.claude/commands/add-skill.md around lines 215 - 224, Fix the markdown in
Step 7 by ensuring proper blank lines and correct ordered list numbering around
the code blocks: add a blank line before the first java code block that
demonstrates creating the header constant (referencing the pattern using
SKILLS_HEADER, toRoutePath and the <NAME_UPPER>_HEADER symbol), restart the
numbering for the next sub-item as "1." and add a blank line after the second
java code block that shows the display-item Route (referencing
<NAME_UPPER>_DISPLAY_ITEM and Route.fromString). Ensure both code fences are
separated from text by blank lines so the markdown renders correctly.


</details>

<!-- This is an auto-generated comment by CodeRabbit -->

Comment on lines +253 to +261
```
./gradlew compileJava
```

If compilation succeeds, run:

```
./gradlew test
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add language specifiers to code blocks.

The shell command blocks should specify shell or bash as the language identifier for proper syntax highlighting.

📝 Proposed fix
 ## Step 11 — Final verification
 
-```
+```shell
 ./gradlew compileJava

If compilation succeeds, run:

- +shell
./gradlew test

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 253-253: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 259-259: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/commands/add-skill.md around lines 253 - 261, The fenced command
blocks in .claude/commands/add-skill.md (the blocks containing "./gradlew
compileJava" and "./gradlew test") lack language specifiers; update each
triple-backtick fence to include a shell language tag (e.g., ```shell or
```bash) so the blocks become ```shell ./gradlew compileJava ``` and ```shell
./gradlew test ``` for proper syntax highlighting.

Comment thread CLAUDE.md
Comment on lines +386 to +399
```java
mcRPGLocalizationManager.registerLanguageFile(myMcRPGLocalization);
```

### Adding a New Locale Key

1. Define a `public static final Route` constant in `LocalizationKey` under the appropriate section header constant:
```java
private static final String MY_SECTION_HEADER = toRoutePath(PARENT_HEADER, "my-section");
public static final Route MY_NEW_KEY = Route.fromString(toRoutePath(MY_SECTION_HEADER, "my-key"));
```
2. Add the corresponding entry to every bundled locale YAML (`en.yml`, `en_gui.yml`, etc. — whichever file owns that section).
3. **Always add new keys in the same PR as the feature that uses them.**

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix markdown formatting in Localization System section.

Multiple markdown formatting issues affect readability:

  • Missing blank lines after code blocks (lines 388, 395, 398)
  • Ordered list numbering should restart at 1 for items on lines 397-398
📝 Proposed formatting fix
 Third-party plugins add custom locale files via:
+
 ```java
 mcRPGLocalizationManager.registerLanguageFile(myMcRPGLocalization);

Adding a New Locale Key

  1. Define a public static final Route constant in LocalizationKey under the appropriate section header constant:
private static final String MY_SECTION_HEADER = toRoutePath(PARENT_HEADER, "my-section");
public static final Route MY_NEW_KEY = Route.fromString(toRoutePath(MY_SECTION_HEADER, "my-key"));

-2. Add the corresponding entry to every bundled locale YAML (en.yml, en_gui.yml, etc. — whichever file owns that section).
-3. Always add new keys in the same PR as the feature that uses them.
+
+1. Add the corresponding entry to every bundled locale YAML (en.yml, en_gui.yml, etc. — whichever file owns that section).
+1. Always add new keys in the same PR as the feature that uses them.

</details>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.21.0)</summary>

[warning] 386-386: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

[warning] 393-393: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

[warning] 396-396: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

---

[warning] 397-397: Ordered list item prefix
Expected: 1; Actual: 2; Style: 1/2/3

(MD029, ol-prefix)

---

[warning] 398-398: Ordered list item prefix
Expected: 2; Actual: 3; Style: 1/2/3

(MD029, ol-prefix)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @CLAUDE.md around lines 386 - 399, Fix the markdown in the "Adding a New
Locale Key" section: ensure there is a blank line after the code fence that
contains mcRPGLocalizationManager.registerLanguageFile(myMcRPGLocalization); and
add a blank line before the "### Adding a New Locale Key" header; wrap the Java
snippet beginning with the LocalizationKey example (references: toRoutePath,
MY_SECTION_HEADER, MY_NEW_KEY, Route) in proper triple-backtick fences with a
blank line after the opening fence and before the closing fence; finally restart
the ordered list numbering so the list items under the code sample start at 1
(i.e., change the two trailing items to "1.") so the ordered list displays
correctly.


</details>

<!-- This is an auto-generated comment by CodeRabbit -->

@DiamondDagger590 DiamondDagger590 merged commit 41cab19 into recode Mar 4, 2026
3 checks passed
@DiamondDagger590 DiamondDagger590 deleted the claude/improve-ai-agent-context-Nc1Of branch March 4, 2026 22:48
DiamondDagger590 added a commit that referenced this pull request Mar 12, 2026
…ation docs (#199)

- .claude/commands/add-skill.md: /add-skill slash command with a 10-step
  checklist covering ConfigFile creation, FileType registration, YAML
  resource, LevelableComponent, skill class, LocalizationKey route,
  locale YAML entry, McRPGExpansion registration, and final verification —
  mirrors the depth of /add-ability for skill authoring

- .cursor/rules/entity-system.mdc: new glob-targeted rule for
  entity/**/*.java and holder/**/*.java covering the full holder hierarchy
  (AbilityHolder → LoadoutHolder → SkillHolder, with McRPGPlayer as a
  composition), when to type to each level, EntityManager retrieval
  patterns, McRPGPlayer retrieval via PlayerManager, and anti-patterns
  around cross-tick holder references

- CLAUDE.md: add Localization System section documenting
  McRPGLocalizationManager locale chain resolution order, BundledLocale
  vs DynamicLocale, LocalizationKey route constant conventions, how to
  send localized messages, and the rule against direct MiniMessage sends;
  update Keeping This File Current maintenance table with entity hierarchy
  and localization change triggers

https://claude.ai/code/session_01A9C5oe6ZEHpfYop6k29mkN

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants