Skip to content

feat: add attachment slots data to article cache#1

Open
diegomarino wants to merge 2 commits intoolchyk98:masterfrom
diegomarino:feat/add-slots-to-cache-data
Open

feat: add attachment slots data to article cache#1
diegomarino wants to merge 2 commits intoolchyk98:masterfrom
diegomarino:feat/add-slots-to-cache-data

Conversation

@diegomarino
Copy link
Copy Markdown

Summary

Adds attachment slots information to the article cache, enabling future BOM (Bill of Materials) generation that accounts for slot requirements and provisions.

What are attachment slots?

In Astroneer, items have specific slot configurations:

  • placedOn: What slot tier is required to place the item (Small, Medium, Large, Extra Large, ground, Widget, Terrain Tool)
  • provides: What slots the item offers to attach other items
  • input/output: For crafters, what resource slots they have (solid, gas, soil, fluid)
  • Special slots: powerConnectors, filterSlot, fuelSlot

Changes

  • types/article.ts: Added ArticleSlots interface with full slot type definitions
  • scrapper/src/cache/_cache.json: Enriched 58 articles with slot data
  • scrapper/src/cache/_llm_doc.md: Generated compact documentation for LLM consumption
  • scrapper/scripts/generateLlmDoc.ts: Script to regenerate LLM doc (pnpm run generate-llm-doc)

Example: Updated JSON with slots data

"Chemistry_Lab": {
  "slots": {
    "placedOn": "Large",
    "input": { "solid": 2, "gas": 1 },
    "output": { "solid": 1 }
  }
}

Example: LLM doc format

- **Chemistry_Lab** | Large | on:Large in:[solid:2,gas:1] out:[solid:1] | @Medium_Printer: 1xTungsten+1xGlass+1xCeramic
- **Medium_Storage** | Medium | on:Medium prv:[s:8] | @Small_Printer: 2xResin
- **Large_Rover** | Extra Large | on:ground prv:[l:2,xl:1] pwr:2 | @Large_Printer: 2xEXO_Chip+1xAluminum_Alloy+1xRubber

Quality checklist

  • JSON is syntactically valid
  • All 191 articles preserve required fields (key, name, iconURL, imageURL)
  • TypeScript compiles without errors
  • Linter passes

## Summary

Adds attachment slots information to the article cache, enabling future BOM (Bill of Materials) generation that accounts for slot requirements and provisions.

## What are attachment slots?

In Astroneer, items have specific slot configurations:
- **placedOn**: What slot tier is required to place the item (Small, Medium, Large, Extra Large, ground, Widget, Terrain Tool)
- **provides**: What slots the item offers to attach other items
- **input/output**: For crafters, what resource slots they have (solid, gas, soil, fluid)
- **Special slots**: powerConnectors, filterSlot, fuelSlot

## Changes

- **types/article.ts**: Added `ArticleSlots` interface with full slot type definitions
- **scrapper/src/cache/_cache.json**: Enriched 58 articles with slot data
- **scrapper/src/cache/_llm_doc.md**: Generated compact documentation for LLM consumption
- **scrapper/scripts/generateLlmDoc.ts**: Script to regenerate LLM doc (`pnpm run generate-llm-doc`)

## Example: Updated JSON with slots data

```json
"Chemistry_Lab": {
  "slots": {
    "placedOn": "Large",
    "input": { "solid": 2, "gas": 1 },
    "output": { "solid": 1 }
  }
}
```

## Example: LLM doc format

```
- **Chemistry_Lab** | Large | on:Large in:[solid:2,gas:1] out:[solid:1] | @Medium_Printer: 1xTungsten+1xGlass+1xCeramic
- **Medium_Storage** | Medium | on:Medium prv:[s:8] | @Small_Printer: 2xResin
- **Large_Rover** | Extra Large | on:ground prv:[l:2,xl:1] pwr:2 | @Large_Printer: 2xEXO_Chip+1xAluminum_Alloy+1xRubber
```

## Quality checklist

- [x] JSON is syntactically valid
- [x] All 191 articles preserve required fields (key, name, iconURL, imageURL)
- [x] TypeScript compiles without errors
- [x] Linter passes
Copilot AI review requested due to automatic review settings December 4, 2025 17:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds attachment slot data to the article cache to enable future Bill of Materials (BOM) generation that accounts for item placement requirements and slot provisions. The implementation includes comprehensive TypeScript type definitions, enriched cache data for 58 articles, and an auto-generated LLM documentation file.

  • Added ArticleSlots interface with slot type definitions including placement requirements, provided slots, input/output flow slots, and special slots (power, filter, fuel)
  • Created generateLlmDoc.ts script to generate compact, token-optimized markdown documentation from cache data
  • Generated _llm_doc.md with 191 articles organized by type, using abbreviated notation for efficient LLM consumption

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

File Description
types/article.ts Adds slot-related TypeScript interfaces (SlotTier, SlotPlacement, SlotCounts, FlowSlots, ArticleSlots) and integrates slots as optional field in Article interface
scrapper/src/cache/_llm_doc.md Auto-generated documentation file with compact notation for 191 Astroneer items, including slot configurations and crafting recipes
scrapper/scripts/generateLlmDoc.ts Script that reads cache JSON and generates abbreviated markdown documentation optimized for LLM token efficiency
scrapper/package.json Adds npm script generate-llm-doc to regenerate the LLM documentation file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scrapper/scripts/generateLlmDoc.ts Outdated
Comment thread scrapper/scripts/generateLlmDoc.ts Outdated
Comment thread scrapper/scripts/generateLlmDoc.ts Outdated
Comment thread scrapper/scripts/generateLlmDoc.ts
Comment thread types/article.ts
- Use explicit length check for empty string (olchyk98#1)
- Add try-catch error handling for file reading (olchyk98#2)
- Fix documentation examples to match actual output (#3)
- Add missing 'mega' abbreviation to PROVIDES_ABBREV and legend (#4)
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