{
 "schema": "aiblocks-page/1",
 "id": "giving-your-agent-a-soul-implementation-planner",
 "type": "skill",
 "name": "Agent role loader builder",
 "summary": "Plan a safer loader for your AI agent's role files, with checked fields, trimming that keeps the rules, clear failures and tests. Draft code only.",
 "headline": "Agent role loader builder",
 "subhead": "Give it your agent's role files, the sections that must never be cut and your size limit. It reviews your loader, or the starter that comes with it. You get the gaps, checks for each file, a safe trimming order, draft code and tests. Nothing is run.",
 "job": {
  "id": "build-software",
  "name": "Build and ship software"
 },
 "level": "intermediate",
 "thinking": "medium",
 "tested": true,
 "updated": "2026-11-03",
 "first_published": "2026-10-25",
 "inputs": [
  {
   "type": "codebase",
   "required": true,
   "label": "Codebase",
   "what": "a project's code, in a folder or repo the AI can open"
  }
 ],
 "outputs": [
  {
   "type": "plan",
   "required": true,
   "label": "Plan",
   "what": "a dated plan: what to do, in what order, with a decision rule for each step"
  },
  {
   "type": "code_change",
   "required": false,
   "label": "Code change",
   "what": "a change to the code, with what it fixes and how it was checked"
  }
 ],
 "you_give": [
  "One or two real role files, or the template filled in",
  "Your size limit, in tokens, for the role file in one call",
  "The sections that must never be cut (the skill assumes Boundaries, Epistemic Rules and Escalation Rules if you don't say)",
  "Your current loader code (optional)",
  "Whether each client has its own role files (optional)"
 ],
 "you_get": [
  "A list of gaps in the loader, each with a proposed fix",
  "A validation spec for each role file field and section",
  "A trim order that never cuts the rules",
  "Draft code changes and the tests to write",
  "A list of what is still missing before you can trust it"
 ],
 "use_when": [
  "You are adding role files to an agent system and need a loader you can trust.",
  "Your agent ignored its own rules after a long role file was trimmed.",
  "You want to compare your loader with a checked starter before you ship.",
  "A broken role file loaded as a default agent and nobody noticed."
 ],
 "skip_when": [
  "You want help writing the role file itself, such as its voice or expertise. Write it in any AI chat. This skill loads and protects the file.",
  "You have no agent code yet. Start with the Scoped base agent builder, then come back here.",
  "Your agent uses one fixed prompt and has no role files. You don't need a loader.",
  "You want to track the cost of each call. Use the Agent AI cost tracker builder."
 ],
 "output_sample": {
  "input": [
   "One or two real role files, or the template filled in",
   "Your size limit in tokens, and the sections that must never be cut",
   "Your current loader code (optional)"
  ],
  "prerequisites": [
   "A project with role files and a loader, or a plan to build one",
   "An AI that can read your code, or code pasted into the chat"
  ],
  "output": [
   {
    "name": "Status",
    "contains": "A plain note that this is a plan and draft code, nothing was run, and what was read."
   },
   {
    "name": "Gaps in the loader",
    "contains": "A table of each problem in the loader, why it matters and the fix."
   },
   {
    "name": "Validation spec",
    "contains": "Required and optional fields, section rules and the error codes a failed load returns."
   },
   {
    "name": "Trim order",
    "contains": "What is cut first to last, what is never cut, and what happens if the rules alone are too big."
   },
   {
    "name": "Code changes",
    "contains": "Draft changes to the loader, marked as untested."
   },
   {
    "name": "Tests to write",
    "contains": "Cases such as a bad agent ID, a missing section, a bad size limit and a file with Windows line endings."
   },
   {
    "name": "Assumptions and next step",
    "contains": "Starting values to check, and the one smallest step to take first."
   }
  ]
 },
 "output_shape": "STATUS\n<plan and draft code only; nothing run; what was read>\n\nEVIDENCE USED\n<role files, loader code, starter, notes>\nMISSING: <each missing input and what it stops>\n\nGAPS IN THE LOADER\n<#> | <what the loader does> | <why it is a problem> | <proposed fix>\n\nVALIDATION SPEC\n<required and optional fields, section rules, error codes>\n\nTRIM ORDER\n<cut first to last, never cut, what happens when the rules alone are too big>\n\nCODE CHANGES (draft, untested)\n<changed functions or a diff>\n\nTESTS TO WRITE\n<number> | <case> | <expected result>\n\nASSUMPTIONS\n<starting values and what to check them against>\n\nNEXT STEP\n<the smallest useful step>",
 "how_to_use": [
  "Open the skill in your AI. A chat AI works if you paste the code in. Claude Code or Codex can read your files.",
  "Paste one or two role files and your loader code. If you have no loader, say so and it reviews the starter.",
  "Name the sections that must never be cut, and your size limit. Say if the limit is for the answer or the whole call.",
  "Read the gaps table first. Check that each problem is real in your project.",
  "Copy the code changes into your project yourself and write the tests. The skill reads code but does not run it.",
  "Before you turn it on, fill each item under MISSING."
 ],
 "checks": [],
 "next": [
  {
   "name": "Breaking change reviewer",
   "url": "https://useaiblocks.com/skills/breaking-change-reviewer",
   "why": "Build it"
  }
 ],
 "source": null,
 "credits": [],
 "files": [
  "references/method-notes.md",
  "references/soul-loader-starter.ts"
 ],
 "links": {
  "page": "https://useaiblocks.com/skills/giving-your-agent-a-soul-implementation-planner",
  "markdown": "https://useaiblocks.com/skills/giving-your-agent-a-soul-implementation-planner.md",
  "json": "https://useaiblocks.com/skills/giving-your-agent-a-soul-implementation-planner.json",
  "instructions": "https://useaiblocks.com/skills/giving-your-agent-a-soul-implementation-planner/SKILL.md",
  "download": "https://useaiblocks.com/skills/giving-your-agent-a-soul-implementation-planner.zip",
  "api_item": "https://useaiblocks.com/api/v1/items/giving-your-agent-a-soul-implementation-planner",
  "api_document": "https://useaiblocks.com/api/v1/documents/skill/giving-your-agent-a-soul-implementation-planner",
  "mcp": "https://useaiblocks.com/mcp"
 }
}
