tool
Standards for mechanical scripts in tools/.
- License 许可
- Apache-2.0
- 所属仓库
- usurobor/cnos
- 最近更新
- 2026-11-07
- Stars
- ★ 9
- Forks
- 0
01 前言 Front Matter
- name
- tool
- scope
- task-local
- triggers
- [ "tool", "script", "automation", "CLI", "utility" ]
- description
- Standards for mechanical scripts in tools/.
- governing_question
- How do we write a mechanical script so it is fail-fast, idempotent, machine-readable, and free of runtime dependencies?
02 资源文件 15
- 参考文档_meta.json281 B
- 脚本lib/kucoin-client.js11.4 KB
- 参考文档package.json836 B
- 参考文档README.md375 B
- 脚本scripts/accounts.js8.7 KB
- 脚本scripts/futures.js11.0 KB
- 脚本scripts/init.js895 B
- 脚本scripts/margin.js21.9 KB
- 脚本scripts/market.js1.3 KB
- 脚本scripts/query.js3.1 KB
- 脚本scripts/spot.js4.1 KB
- 脚本scripts/transfer.js4.5 KB
- 参考文档skill.json2.1 KB
- 参考文档SOURCE.md252 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Tool
Standards for mechanical scripts in tools/.
When
- Task is mechanical
- No judgment required
- AI would burn tokens on clockwork
Principles
- Zero runtime deps (bash, git, coreutils, jq)
- NO_COLOR support
- Prereq checks (fail fast)
- Idempotent (safe to re-run)
- Machine-readable output
set -euo pipefail
Template
#!/bin/bash
# tool-name.sh — description
# Usage: ./tools/tool-name.sh [args]
# Exit: 0=success, 1=error, 2=no-op
set -euo pipefail
if [[ -n "${NO_COLOR:-}" ]]; then
RED="" GREEN="" RESET=""
else
RED='\033[0;31m' GREEN='\033[0;32m' RESET='\033[0m'
fi
check_prereqs() {
command -v git &>/dev/null || { echo "Missing: git" >&2; exit 1; }
}
main() {
check_prereqs
# logic
echo -e "${GREEN}✓${RESET} Done"
}
main "$@"
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error |
| 2 | No-op (already done) |
04 同仓库更多 Skills
issues/triage
Issue triage doctrine pointer. Use when classifying a new issue, deciding dispatch eligibility, or deciding whether to close/supersede/defer.
issues/taxonomy
Issue label taxonomy pointer. Use when classifying an issue's kind/area/priority/effort/status/protocol/dispatch labels, or when the board needs to interpret them.
issues/map
Issue-board (Issue Pivot) generation domain. Use when reasoning about `cn issues map`'s fetch, taxonomy-parse, effort-computation, and render pipeline, or about the board's JSON/HTML output contract.
issues
cnos.issues package entrypoint. Use when reasoning about issue taxonomy, the Issue Pivot / issue-board (`cn issues map`), the read-only CDS issue-state evaluator (`cn issues fsm evaluate`), or the current command-dispatch disposition of issue tooling.
receipt-stream
Cross-cycle receipt-stream doctrine for protocol-iteration. Use when γ closes a cycle and writes the per-cycle iteration artifact (`cdd-iteration.md`), when γ updates the cross-cycle aggregator at `.cdd/iterations/INDEX.md`, when ε reads the receipt stream across cycles to surface protocol-gap patterns, when a finding's disposition lands a cross-repo patch and the cross-repo trace bundle attaches, or when a courtesy empty-findings stub is written for a `protocol_gap_count == 0` cycle.
mid-flight
Mid-flight γ→in-flight-α rescue channel. Use when γ needs to change a load-bearing fact (pinned axis, scope, AC, blocker) after α has begun coding, when γ edits the cycle's GitHub issue body mid-cycle, or when a spec change lands on origin/main while α/β polling sessions are in-flight.