t1k:agent-creator
| Field | Value |
|---|---|
| Module | t1k-maintainer |
| Version | 2.18.3 |
| Effort | medium |
| Tools | AskUserQuestion, Bash, Edit, Glob, Grep, Read, Write |
Keywords: agent, create, frontmatter, maxturn, model, scaffold, update
How to invoke
Section titled “How to invoke”/t1k:agent-creator[agent-name]Agent Creator
Section titled “Agent Creator”Create new agent .md files or update existing ones for TheOneKit. Enforces the canonical agent structure.
Required Frontmatter
Section titled “Required Frontmatter”Canonical field order: name → description → model → maxTurns → color → roles → tools → context → useExactTools → origin → repository → module → protected → version
| Field | Required | Notes |
|---|---|---|
name | Yes | Universal t1k- prefix, kebab-case, MUST match filename basename. Core: t1k-{slug}. Kit-wide: t1k-{kit}-{slug}. Module-scoped: t1k-{kit}-{module}-{slug}. See rules/naming-convention.md (SSOT) and references/architecture-rules.md § 0. CI gate validate-agent-prefix.cjs is strict. |
description | Yes | | block scalar; 1-sentence intent + 1–3 <example> blocks with <commentary>; total <30 lines, <2KB |
model | Yes | haiku (cheap fanout/discovery) · sonnet (default) · inherit (parent-pinning) · opus unused |
maxTurns | Yes | See observed values below; must justify >40 in a comment |
color | Yes | 14/14 agents use it — required, not suggested. See color-by-role below |
roles | Yes | [routing-role] registers in routing JSON · none (scalar) = callable by name only · [] = same as none, prefer none |
tools | If fork-eligible | Explicit minimal array [Read, Glob, Bash] — omitting inherits ~70-tool default, breaking useExactTools SSOT |
useExactTools | If fork-context | true for agents that run as fork children — parent mirrors tools: array exactly |
context | If fork-context | fork when agent runs as fork child of a skill |
origin | Yes | Hand-stamp on creation — validator enforces pre-merge for new files. Cite memory feedback_origin_marker_handauthor.md. |
repository | Yes | Hand-stamp on creation (same rule) |
module | Yes | Hand-stamp on creation (same rule) |
protected | Yes | Hand-stamp on creation (same rule) |
version | CI-managed | CI injects from module.json. Appears post-release — do NOT hand-edit. |
Agents do NOT have keywords: in frontmatter. Keywords live in t1k-activation-{layer}.json only.
Color-by-role convention: blue=t1k-planner/PM/implementer · red=t1k-debugger · green=t1k-tester/git · orange=reviewer · purple=kit/docs · yellow=t1k-brainstormer/simplifier · cyan=t1k-researcher/mcp · magenta=skills
Recommended maxTurns (observed from 14 core agents)
Section titled “Recommended maxTurns (observed from 14 core agents)”| Agent | maxTurns | Role class |
|---|---|---|
| t1k-git-manager | 15 | utility |
| t1k-code-simplifier, t1k-docs-manager | 20 | utility |
| t1k-tester, t1k-researcher, t1k-code-reviewer, t1k-project-manager, t1k-brainstormer | 25 | reviewer/t1k-planner |
| t1k-planner, t1k-skills-manager | 30 | t1k-planner |
| t1k-debugger, t1k-fullstack-developer | 40 | implementer/t1k-debugger |
| t1k-kit-developer | 45 | kit-implementer |
Cap at 50. Must justify >40 with an inline comment.
Required Body Sections (in order)
Section titled “Required Body Sections (in order)”- Opening persona: “You are a {Role Title} …” — see Cognitive Framing
- Routing guard (if applicable): scope boundary + delegation targets
- Mandatory skills: Ordered table with activation triggers
- Constraints: Enforced rules (NEVER/ALWAYS/DO NOT)
- Workflow: Numbered steps with verification checkpoints
- Output format: Constant-shape markdown template (no variable-cardinality keys in headers)
- Domain Agent Orchestration (if applicable): see pattern below
- Behavioral Checklist: 6–10 checkbox lines, brutal-honesty framing — MANDATORY for all agents
- Module awareness (if applicable):
metadata.json has modules/schemaVersion >= 2conditions
Auto-register (fast path) — never hand-stamp + hand-place
Section titled “Auto-register (fast path) — never hand-stamp + hand-place”Per rules/replicate-and-automate.md: don’t repeat the manual create-file → stamp-frontmatter → edit-module.json → regen dance. Use the scaffolder:
t1k agent new <name> --module <owner> --model <tier> # haiku | sonnetIt creates the t1k--prefixed agent .md (dash-form name: == basename per rules/naming-convention.md) with stamped frontmatter including an explicit model: tier (NO model: inherit — every kit agent pins a concrete tier per agent-model-tier-rubric), appends to the owning module.json agents[], and regenerates t1k-modules.json (via generate-modules-registry.cjs). You then write the body. Requires CLI ≥ 5.4.0 (t1k --version).
Manual fallback (CLI < 5.4.0): create the agent .md yourself, hand-stamp frontmatter (pin a concrete model: tier), append to module.json agents[], then run node <release-action>/scripts/generate-modules-registry.cjs <kit-root> and stage t1k-modules.json in the SAME commit (rules/module-registry-sync.md).
Process
Section titled “Process”- Ask user for: role name, scope, which kit/layer, key skills
- Read 2 existing agents as reference (matching role type)
- Draft agent following canonical structure above
- Hand-stamp origin frontmatter —
origin/repository/module/protectedMUST be present on the new file. Validator only checksorigin:presence; values may be best-effort (CI overwrites post-merge). See “Required Frontmatter” above. - Post-write check — read the new agent .md back; verify the frontmatter contains
origin:with a non-empty value. If absent, re-stamp before proceeding. - Validate using
references/validation-checklist.md - If routing needed: update
t1k-routing-{layer}.json - If activation needed: update
t1k-activation-{layer}.json
Cognitive Framing (MANDATORY — first line of body)
Section titled “Cognitive Framing (MANDATORY — first line of body)”Format: “You are a {Role Title} who/performing {behavioral description in 1-2 sentences}.”
Examples:
- “You are a Staff Engineer hunting production bugs — you distrust obvious answers and prove root cause before proposing any fix.”
- “You are a QA Lead performing systematic verification — you hunt for untested code paths and think like someone burned by production incidents.”
- “You are a Tech Lead designing system architecture — you optimize for long-term maintainability over short-term convenience.”
Validation: If the opening line does not name a concrete role with a behavioral trait, reject and rewrite.
Domain Agent Orchestration (6/14 agents use this)
Section titled “Domain Agent Orchestration (6/14 agents use this)”After completing generic implementation, check for domain-specific agents:
**Domain Agent Orchestration:**1. Use Glob to find `.claude/agents/*-{role}.md`2. Evaluate which are relevant to the task (engine-specific, module-specific)3. For relevant domain agents: spawn via Agent tool with implementation context4. Fan-out cap: `Math.min(matchedCount, 4)` — NEVER spawn unbounded parallel agents5. If no domain agents found — proceed with generic output only
IF `T1K_FORK_DEPTH` env >= 2: skip Domain Orchestration entirely;report "domain-agents-skipped: depth-limit-reached" in output.Fork-context agents
Section titled “Fork-context agents”If an agent may run as a fork child of a skill (verifier, t1k-researcher, t1k-planner, reviewer, t1k-tester, t1k-debugger):
Frontmatter required:
tools: [Read, Grep, Glob](minimal explicit array) — omitting breaksuseExactToolsSSOT across 13/14 agentsuseExactTools: trueif spawned bycontext: forkskill
Body required (verifier agents — testers, reviewers, debuggers):
**Anti-Avoidance Checklist (read before every run):**- No "should work" without evidence — run the command, paste the output.- No "looks fine to me" without a root-cause sentence.- No "I'll skip this edge case" without explicit risk justification.- No "this is unrelated" without a 1-line proof.Constant-shape Output Format: headers MUST NOT interpolate counts, timestamps, or commit hashes into top-level keys. Variable values go inside leaf nodes.
- GOOD:
### Files Modified\n[list] - BAD:
### Files Modified (3 files, 187 lines):— count busts cache
Recursion guard: If body contains Domain Agent Orchestration, gate with T1K_FORK_DEPTH check. Never reference the gitStatus block — run git status yourself if needed.
See skills/t1k-architecture/references/fork-hygiene.md for parent-side rules.
Anti-Patterns to Avoid
Section titled “Anti-Patterns to Avoid”Severity: Blocker (security/correctness) · High (cache/recursion/cost) · Medium (drift/clarity) · Low (style)
| Anti-pattern | Severity | Fix |
|---|---|---|
No recursion guard when Agent/Task tool in tools: array | Blocker | Add depth check: refuse to spawn self; gate domain orchestration with T1K_FORK_DEPTH |
| No fan-out cap on domain-agent spawning | High | Cap at Math.min(N, 4) |
Inlining rules/skill-security-boilerplate.md or rules/agent-security-boilerplate.md content | High | Auto-loaded from rules/. Inlining drifts. Current offender: t1k-skills-manager.md:47-56 |
Volatile content in body (gitStatus, date +, “Last Updated”, live shell `...`) | High | Move to a tool call AFTER the static prefix. See architecture-rules.md §E |
tools: includes Bash for read-only agents | Medium | Read-only agents declare [Read, Glob, Grep] — Bash grants rm, git push --force |
maxTurns > 50 without justification | High | Cap at 50; add inline comment if >40 |
| Vague persona (“a developer”) | Medium | Concrete role + behavioral trait — see Cognitive Framing above |
roles: [] instead of roles: none | Low | Prefer none scalar for no-routing agents |
Copy-pasted <example> blocks across agents | Medium | Each agent’s examples must be domain-specific for routing disambiguation |
Adding origin, module, protected, version with wrong values | High | origin/module/protected — hand-stamp exact kit values; version — leave to CI post-release |
| Verifier agent without Anti-Avoidance Checklist | Medium | Testers/reviewers/debuggers MUST include the 4-bullet checklist |
Agent body recommends raw rm -rf .claude/ | Blocker | Wrap in t1k install --reset / t1k doctor --nuke (CLAUDE.md #10) |
Full architecture checklist: references/architecture-rules.md
Pre-merge agent checklist: references/validation-checklist.md