kiro-discord-bot: Instructions file for Kiro

.kiro/steering/project.md

project-contract is an instructions file for Kiro from nczz/kiro-discord-bot. It costs 4,620 tokens per session, scanned A, original, MIT.

A project-specific rulebook for building, running, testing, and diagnosing a Go Discord bot and its MCP server. MCP is a standard way for an AI tool to connect to external services.

In plain words
What is it for?
Use it for Go development, builds, tests, local runs, release checks, configuration work, and debugging the bot or MCP server.
Why use it?
It keeps code changes aligned with the repository's architecture, commands, configuration, and source-of-truth rules instead of relying on assumptions.

Instructions file for Kiro

Written for Kiro: installed under .kiro/. Also seen: mentions AGENTS.md.

This is nczz/kiro-discord-bot's own configuration. It tells Kiro how to work on kiro-discord-bot itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kiro-discord-bot configures →

Reuse

Borrowing it

Nothing to install: this file belongs to nczz/kiro-discord-bot. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nczz/kiro-discord-bot/main/.kiro/steering/project.md
Clone the repo
git clone --depth 1 https://github.com/nczz/kiro-discord-bot

Made for: Kiro.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for project-contract

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nczz/kiro-discord-bot/project/github.svg)](https://agentmods.dev/instructions/nczz/kiro-discord-bot/project)
Your own site
<a href="https://agentmods.dev/instructions/nczz/kiro-discord-bot/project"><img src="https://agentmods.dev/badge/instructions/nczz/kiro-discord-bot/project/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for project-contract

Your own site · 80×15
<a href="https://agentmods.dev/instructions/nczz/kiro-discord-bot/project"><img src="https://agentmods.dev/badge/instructions/nczz/kiro-discord-bot/project.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,620 This file is loaded in full into every session.
When invoked 4,620 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.04620 $0.04620
Opus 5.5 $0.01848 $0.01848
Sonnet 5.5 $0.00924 $0.00924
Haiku 4.5 $0.00462 $0.00462

Measured 1mo ago against content hash 837b7af1af3f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

project-contract scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.kiro/steering/project.md · 152 lines

How it starts

The opening of the file, as written. The whole thing — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.

kiro-discord-bot — Project Contract

AGENTS.md at the repository root is the cross-agent entrypoint. This Kiro steering file is the deeper project contract for architecture, recurring rules, and verification details. If AGENTS.md, .kiro/steering/*, and docs disagree, stop and resolve the source-of-truth drift before implementation.

Build & Run

  • Build: go build -o kiro-discord-bot .
  • Build MCP server: go build -o mcp-discord ./cmd/mcp-discord/
  • Test: go test ./...
  • Single package test: go test ./acp/
  • Release preflight: scripts/release-preflight.sh
  • Local ACP smoke: RUN_ACP_SMOKE=1 KIRO_CLI=$(which kiro-cli) scripts/release-preflight.sh
  • Run: systemctl start kiro-discord-bot (systemd, recommended) or export $(grep -v '^#' .env | xargs) && ./kiro-discord-bot (manual)
  • Config: bot settings from .env, see config.go loadConfig(); Discord MCP-only settings are read in cmd/mcp-discord/
  • Diagnostics: /doctor or !doctor checks kiro-cli, default cwd, cwd allowlist, data dir writeability, and ACP preflight

Architecture Boundaries

main.go          → loadConfig + bot.Start + signal wait
config.go        → .env → Config struct (mustEnv / envOr / envInt / envBool)
bot/             → Discord gateway, slash commands, message routing
  handler.go     → message + slash command dispatch (不放業務邏輯)
  handler_cron.go→ /cron Modal, /cron-list Button, /remind
  notifier.go    → shared botNotifier (Notify+IsSilent) embedded by all adapters
  health_adapter → heartbeat.HealthDeps bridge
  cron_adapter   → heartbeat.CronDeps bridge
  thread_cleanup_adapter → heartbeat.ThreadCleanupDeps bridge
  channel_cleanup_adapter → heartbeat.ChannelCleanupDeps bridge
channel/         → per-channel lifecycle
  manager.go     → session + worker + agent 生命週期管理中樞、cwd allowlist enforcement
  worker.go      → job queue goroutine, thread-based execution
  session.go     → SessionStore JSON persistence
  logger.go      → JSONL conversation log
acp/             → kiro-cli ACP child process (JSON-RPC over stdio)
  agent.go       → spawn, handshake (session/new or session/load), ask, cancel, stop, set_model, set_mode
  jsonrpc.go     → ndjson transport
  ringbuf.go     → thread-safe ring buffer for stderr capture
  protocol.go    → ACP constants, capability structs, PromptContent (protocol version 1)
heartbeat/       → background task loop
  health.go      → agent liveness check + auto-restart
  gateway.go     → Discord Gateway heartbeat ACK watchdog + reconnect/escalate
  cleanup.go     → expired attachment removal
  cron.go        → cron scheduler + temp agent execution
  cron_store.go  → cron job JSON persistence
  schedule.go    → natural language → cron/time parser
  thread_cleanup.go → idle thread agent eviction
  channel_cleanup.go → idle channel agent eviction
cmd/mcp-discord/ → optional pure Discord REST MCP server + direct formatting/file/mention guards
scripts/         → repeatable local release/preflight checks
docs/release.md  → release and deployment safety checklist
.github/         → CI preflight workflow for push/PR checks
.kiro/steering/360-review-handoff.md → evidence-first review, fix, verification, and handoff loop
.kiro/steering/review-examples.md → concrete examples of rigorous review and reuse discipline
.kiro/steering/decision-failure-patterns.md → architecture decisions, non-goals, recurring failures, regression expectations

Read the full file on GitHub · 152 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +1 lines · +112 tokens per session 837b7af1af3f
  2. 1mo ago Changed · +37 tokens per session b25a549250a1
  3. 1mo ago Changed · +1 lines · +19 tokens per session f59ff5812836
  4. 1mo ago First seen · 150 lines · 4,452 tokens per session scan A 10f6803261d3

Subscribe to this mod's changes

project-contract is an instructions file published in the GitHub repository nczz/kiro-discord-bot (44 stars, last pushed 16d ago), licensed MIT. It adds 4,620 tokens to every session, about $0.0185 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-07.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,461 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens