gotask: Instructions file for Kiro

ai_rules/.kiro/steering/task.md

gotask task.md is an instructions file for Kiro from langhuihui/gotask. It costs 2,423 tokens per session, scanned A, original, MIT.

Project instructions for GoTask, a Go framework where work is represented as tasks arranged in parent-child trees.

In plain words
What is it for?
Developing GoTask code while following its single-event-loop design, task hierarchy, and resource-cleanup rules.
Why use it?
They give the coding agent rules for task execution, cleanup, and shutdown, helping it avoid unsafe concurrency and lifecycle mistakes.

Instructions file for Kiro

Written for Kiro: installed under .kiro/.

This is langhuihui/gotask's own configuration. It tells Kiro how to work on gotask 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 gotask configures →

Reuse

Borrowing it

Nothing to install: this file belongs to langhuihui/gotask. 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/langhuihui/gotask/main/ai_rules/.kiro/steering/task.md
Clone the repo
git clone --depth 1 https://github.com/langhuihui/gotask

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 gotask task.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/langhuihui/gotask/task/github.svg)](https://agentmods.dev/instructions/langhuihui/gotask/task)
Your own site
<a href="https://agentmods.dev/instructions/langhuihui/gotask/task"><img src="https://agentmods.dev/badge/instructions/langhuihui/gotask/task/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 gotask task.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/langhuihui/gotask/task"><img src="https://agentmods.dev/badge/instructions/langhuihui/gotask/task.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,423 This file is loaded in full into every session.
When invoked 2,423 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.02423 $0.02423
Opus 5.5 $0.00969 $0.00969
Sonnet 5.5 $0.00485 $0.00485
Haiku 4.5 $0.00242 $0.00242

Measured 28d ago against content hash 57fe0792cb93, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

gotask task.md 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 28d 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.

ai_rules/.kiro/steering/task.md · 387 lines

How it starts

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

Kiro AI Rules for GoTask Project

Project Context

GoTask is an asynchronous task management framework for Go that implements an "Everything is a Task" philosophy. It provides OS-like task manager capabilities with precise control over different granularity levels of system components.

Core Architectural Principles

1. Single Goroutine Event Loop (CRITICAL)

  • NEVER create goroutines directly in task implementations
  • All child tasks execute sequentially in the parent task's goroutine
  • This eliminates race conditions and ensures predictable execution
  • Use parent.AddTask(child) instead of go func()

2. Task Hierarchy and Lifecycle

  • Tasks form a tree structure with parent-child relationships
  • Each task has a unique ID for tracking and management
  • Use RootManager as the root task manager for signal handling
  • Implement proper Start(), Run(), and Dispose() methods

3. Resource Management Philosophy

  • Framework handles cascading disposal automatically
  • Use OnStop() and OnDispose() hooks for cleanup
  • Implement graceful shutdown patterns
  • Never call Start() directly - it must be called by the parent task

Task Type System

task.Task (Base Task)

  • Use for simple, single-purpose tasks
  • Basic task implementation with lifecycle methods

task.Job (Container Task)

  • Can contain child tasks
  • Ends when all child tasks complete
  • Use for task coordinators and containers

task.Work (Persistent Task)

  • Similar to Job but continues after children complete
  • Use for background workers and long-running services

task.TickTask (Periodic Task)

  • Executes at regular intervals
  • Implement GetTickInterval() time.Duration
  • Use for timers, heartbeats, cleanup tasks

task.ChannelTask (Event-Driven Task)

  • Custom signal-based tasks
  • Override GetSignal() method
  • Use for event-driven and reactive tasks

Implementation Patterns

Standard Task Template

type MyTask struct {
    task.Task  // Choose appropriate type
    // Task-specific fields
    Name        string
    Config      map[string]interface{}
    Resources   []Resource
}

func (t *MyTask) Start() error {
    // Resource initialization
    t.Info("Task starting", "name", t.Name, "taskId", t.GetID())
    
    // Add resource dependencies
    t.Using(t.Resources...)
    
    // OnStop: 用于关闭阻塞性资源(如端口监听、网络连接)
    t.OnStop(func() {
        // 关闭阻塞性资源,如 server.Close(), conn.Close()
        server.Close()
    })
    
    // OnDispose: 用于清理非阻塞性资源
    t.OnDispose(func() {
        // 清理其他资源,如缓存、文件句柄等
        cache.Flush()
    })
    
    return nil
}

func (t *MyTask) Run() error {
    // Main task logic (blocking)
    for !t.IsStopped() {
        // Do work
        if err := t.doWork(); err != nil {
            return err
        }
    }
    return t.StopReason()
}

func (t *MyTask) Dispose() {
    // Resource cleanup
    t.Info("Task disposing", "name", t.Name)
    for _, resource := range t.Resources {
        resource.Close()
    }
}

Read the full file on GitHub · 387 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. 28d ago First seen · 387 lines · 2,423 tokens per session scan A 57fe0792cb93

Subscribe to this mod's changes

gotask task.md is an instructions file published in the GitHub repository langhuihui/gotask (76 stars, last pushed today), licensed MIT. It adds 2,423 tokens to every session, about $0.0097 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-30.

Related

Other instructions, from other repositories