Agent skill
smith-ctx-kiro
Kiro-specific context management with terminal limitations, Serena MCP as mandatory tool, and file operation workarounds. Use when operating in Kiro IDE. LOAD FIRST in all Kiro sessions - critical platform constraints that prevent hangs and failures.
Install this agent skill to your Project
npx add-skill https://github.com/tianjianjiang/smith/tree/main/smith-ctx-kiro
SKILL.md
Kiro Context Management
- Scope: Kiro-specific context management, terminal limitations, tool preferences
- Load if: Using Kiro IDE (ALWAYS load first in Kiro sessions)
- Prerequisites: None (this file loads before other rules)
CRITICAL: Terminal Limitations (Primacy Zone)
Terminal commands that cause Kiro to freeze:
- NEVER use
echowith double quotes (causes hang) - NEVER use heredoc syntax (
<<EOF) (fails in Kiro terminal) - NEVER use complex zsh themes (powerlevel10k, oh-my-zsh cause timeouts)
- NEVER use interactive editors (vim, nano) in automated commands
- NEVER use pagers (less, more) in automated commands
- NEVER chain commands with
&&or||in complex scripts - NEVER expect second command in same session to return reliably (zsh bug)
Terminal best practices for Kiro:
- Use Python scripts instead of complex shell commands
- Write output to files, then read files (not echo)
- Use
-mflag with git commit (avoid editor) - Use
--no-pagerwith git commands - Use simple bash syntax over zsh features
- Run one command per terminal invocation when possible
- Add timeouts to long-running commands
CRITICAL: Serena MCP is Mandatory
When Serena MCP is available, you MUST use Serena tools for all file operations.
Kiro native tools have known reliability issues:
strReplacefails on duplicate contentreadFilesilently truncates large files- File writes can create duplicate sections
- Mid-operation aborts during file reads/edits
Tool Preference Order (mandatory):
- Reading code:
find_symbol,get_symbols_overview>readFile - Editing code:
replace_content(regex mode) >strReplace - Navigation:
find_referencing_symbols>grepSearch - Context:
write_memory,read_memoryfor persistent state
- Using Kiro
strReplacewhen Serenareplace_contentis available - Using Kiro
readFilefor large files when Serena tools are available - Ignoring Serena MCP availability
Serena Activation Workflow
At session start:
- Check if Serena MCP is available
- Run
activate_projectto initialize - Run
check_onboarding_performedto verify setup - Run
list_memoriesto discover available context - Run
read_memoryfor relevant project context
During work:
- Use
write_memoryfor important discoveries - Use semantic tools (
find_symbol,replace_content) over text-based
Before compaction (70% context):
- Save session state with
write_memory
AGENTS.md Integration
Kiro automatically loads AGENTS.md from workspace root (Kiro v0.5.0+). No separate .kiro/steering/ files needed.
How it works:
- Place AGENTS.md at workspace root
- Kiro reads it automatically at session start
- Include instructions for loading domain-specific files
- Critical rules (terminal limitations) embedded directly with XML tags
- @smith-ctx/SKILL.md - Universal context strategies
@smith-serena/SKILL.md- Serena MCP tools (mandatory for Kiro)
ACTION (Recency Zone)
Proactive context management:
- Prompt for context status periodically
- At 70%: Warn that 80% auto-summarize is approaching
- Save important context to Serena memory before 80%
Platform auto-summarizes at 80% - agent prepares user by saving state first.
In Kiro sessions:
- Avoid echo with double quotes
- Use Python scripts for file generation
- Use Serena MCP tools (mandatory, not optional)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
smith-style
File naming, path standards, and conventional commits. Use when naming files, creating branches, writing commit messages, or setting up new projects. Covers underscore vs hyphen conventions, commit format, and branch naming patterns.
smith-stacks
Stacked pull request workflows for large features. Use when creating stacked PRs, managing dependent PRs, or rebasing after parent merges. Covers stack creation, merge order, and squash merge handling.
smith-python
Python development with uv, pytest, ruff, and type hints. Use when writing Python code, running tests, managing Python packages, or working with virtual environments. Covers import organization, type hints, pytest patterns, and environment variables.
smith-principles
Fundamental coding principles (DRY, KISS, YAGNI, SOLID, HHH). Use when starting any development task, evaluating implementation approaches, or reviewing code quality. Always active as foundation for all development decisions.
smith-nuxt
Nuxt 3 development patterns including auto-import stubbing for tests, environment variable conventions, and middleware testing. Use when working with Nuxt projects, testing Nuxt components/middleware, or configuring Nuxt environment variables.
smith-plan
Plan tracking protocol (portable). Progress tracking with checkboxes, iteration workflow, completion/blocker signals. Use when executing multi-step plans, tracking task progress, or working from plan files. IMPORTANT - Always update the plan file after completing tasks.
Didn't find tool you were looking for?