Garbage Collection
DevelopmentGarbage Collection is an Agent Skill for development published in the a5c-ai/babysitter repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Expert skill for garbage collector design and implementation including various collection algorithms
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/a5c-ai/babysitter/blob/HEAD/library/specializations/programming-languages/skills/garbage-collection/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/garbage-collection, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Garbage Collection Skill
Overview
Expert skill for garbage collector design and implementation including various collection algorithms.
Capabilities
- Implement mark-sweep collection
- Implement copying/semi-space collectors
- Implement generational collection with write barriers
- Implement concurrent/incremental marking (tri-color)
- Design object header layouts and type info
- Implement precise vs conservative root scanning
- Design card table and remembered set implementations
- Implement finalizers and weak references
Target Processes
- garbage-collector-implementation.js
- memory-allocator-design.js
- interpreter-implementation.js
- bytecode-vm-implementation.js
Dependencies
GC Handbook literature (Jones, Hosking, Moss)
Usage Guidelines
- Algorithm Selection: Start with simple mark-sweep, evolve to generational as needed
- Write Barriers: Design write barriers early if considering generational/concurrent GC
- Root Scanning: Implement precise root scanning for safety
- Pause Times: Measure pause times and optimize for application requirements
- Testing: Build GC stress tests and allocation-heavy benchmarks
Output Schema
{
"type": "object",
"properties": {
"algorithm": {
"type": "string",
"enum": ["mark-sweep", "copying", "mark-compact", "generational", "concurrent"]
},
"writeBarrier": {
"type": "string",
"enum": ["none", "card-table", "remembered-set", "snapshot-at-beginning", "incremental-update"]
},
"rootScanning": {
"type": "string",
"enum": ["conservative", "precise"]
},
"generatedFiles": {
"type": "array",
"items": { "type": "string" }
}
}
}