harness.upstream

harness.upstream is a command for Claude Code from hahaxiang27/FlowHarness. It costs 54 tokens per session (1,509 once invoked), scanned A, original, MIT.

A command for recording a proposed project rule or a lesson from an incident in a pending document. The entry waits for a later human review before becoming part of the project constitution, which is the document defining the project’s rules.

In plain words
What is it for?
Use it to add a one-sentence rule, record an incident with its symptom, cause, and remedy, or reserve a recurring pattern for future documentation.
Why use it?
It prevents useful lessons from reviews and failure investigations from being forgotten while avoiding immediate changes to the project’s active rules. A person can later accept, edit, or reject each proposal.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to add a one-sentence rule, record an incident with its symptom, cause, and remedy, or reserve a recurring pattern for future documentation.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hahaxiang27/flowharness/harness.upstream
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/hahaxiang27/FlowHarness

Made for: Claude Code.

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 harness.upstream

README.md
[![agentmods](https://agentmods.dev/badge/commands/hahaxiang27/flowharness/harness.upstream/github.svg)](https://agentmods.dev/commands/hahaxiang27/flowharness/harness.upstream)
Your own site
<a href="https://agentmods.dev/commands/hahaxiang27/flowharness/harness.upstream"><img src="https://agentmods.dev/badge/commands/hahaxiang27/flowharness/harness.upstream/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 harness.upstream

Your own site · 80×15
<a href="https://agentmods.dev/commands/hahaxiang27/flowharness/harness.upstream"><img src="https://agentmods.dev/badge/commands/hahaxiang27/flowharness/harness.upstream.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,509 The whole file, excluding the scripts and references it only reads on demand.
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.00054 $0.01509
Opus 5 $0.00027 $0.00754
Sonnet 5 $0.00011 $0.00302
Haiku 4.5 $0.00005 $0.00151

Measured 8d ago against content hash 1b6116cb7086, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

harness.upstream 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 8d 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.

commands/harness.upstream.md · 101 lines

What it actually says

User Input

$ARGUMENTS

格式�?``` /harness.upstream constitution "<纪律一句话>" /harness.upstream incident "<症状>" "<根因>" "<修法>" "<触发哪条规则升级>" /harness.upstream pattern ""


�?`constitution` 子命令是 Q2 PoC 必达;`incident` / `pattern` �?Q3 完整版预留位�?
## Outline

**用�?*:让评审�?/ 故障复盘 / �?Sprint 现场识别�?早该有的规则"�?5 分钟内落到文档,不丢失�?
**关键约束**�?- 本命�?*不修�?* `.specify/memory/constitution.md`。修改的�?`.specify/memory/constitution-pending.md`(待审条目)�?- 待审条目下次�?`/speckit.constitution` 时由用户人工裁决:吸�?/ 修改 / 拒绝�?- 不允许此命令直接升原则编�?/ �?MAJOR 版本 �?那是 `/speckit.constitution` 的职责�?
## Subcommand: constitution

**输入**:单参数,一句话纪律陈述�?
**执行流程**�?
1. 解析输入。如果输入为空或不像一句完整陈述,提示用户重写�?
2. 读取 `.specify/memory/constitution.md`,识别现有原则编号上限(�?XII),下一编号�?PENDING-{N}�?
3. 读取 `.specify/memory/constitution-pending.md`(不存在则用以下骨架创建):
   ```markdown
   # Constitution Pending Principles

   待审条目。等下次 /speckit.constitution 正式吸纳�?
   ---
  1. 基于用户输入,AI 推导以下字段并填入待审条目模板(不要让用户手填这些字段,AI 自己�?+ 标置信度):

    • 触发故事:从用户输入中识�?在哪�?Sprint / 任务 / 现场踩到�?。如果用户输入没说,�?待补 · /harness.upstream 时未提供"�? - **不可协商�?*:硬约束 / 软约�?/ 信息性。AI 按以下规则判�? - �?必须 / 禁止 / 不允�?/ 阻断"等强�?�?硬约�? - �?建议 / 应该 / 优先" �?软约�? - 仅描述事�?�?信息�? - 影响清单(候选):哪�?prompts / templates / commands 文件可能要联动改。AI 用关键词匹配粗略给候选清单(如纪律提�?测试" �?evaluator.md / spec-template.md),最终由 /speckit.constitution 时人工核对�? - 预估版本�?bump:MAJOR / MINOR / PATCH(按 speckit.constitution 的语义版本规则)�?
  2. �?constitution-pending.md 末尾追加�? ```markdown

    PENDING-{N}:{AI 起的简短标题}

    原始陈述: {用户输入逐字}

    触发故事: {步骤 4 推导} **不可协商�?*: {�?�?信息性} 影响清单(候选): {文件清单} 预估版本 bump: {MAJOR/MINOR/PATCH}

    添加时间: {ISO 日期时间} **添加�?: /harness.upstream constitution **状�?: 待审


  3. 输出 Sync Impact Report 草稿�?stdout(不写入文件):

    ## Sync Impact Report (draft · pending review)
    
    PENDING-{N} 已加�?constitution-pending.md�?
    - 标题:{AI 起的标题}
    - 不可协商度:{...}
    - 影响清单候选:{...}
    
    下一步:�?/speckit.constitution 时人工裁决�?   或运�?/harness.upstream constitution 删除 PENDING-{N}(如发现录错)来撤回�?   ```
    
    
  4. 不输出其他内容�?用户付出 �?5 分钟*:输入一句话即可。AI 全推导�?

Subcommand: incident

Q3 上线。Q2 �?evaluator FAIL 后强制弹出的 5 分钟复盘模板(Task #17)替代�? 格式预留�? 字段(症�?/ 根因 / 修法 / 触发哪条规则升级),落到 .harness/incidents/{ts}-{task-id}.md�?

Subcommand: pattern

Q3 上线。识�?evaluator FAIL 案例规模化模式(�?3 次同类失败),归档到 .harness/patterns/,喂 LoRA 训练池�?

验收

  • /harness.upstream constitution "测试必须�?cycle 断言" �?�?constitution-pending.md 追加 PENDING-{N} + 输出 Sync Impact Report 草稿
  • 不修�?constitution.md 主文�?- 用户全程 �?5 分钟(仅一句话输入�?- 下次 /speckit.constitution 时能读到待审条目并提示用户处�?

设计依据

  • �?4.4.1.4 �?5 分钟积累机制"
  • �?4.5.4 �?反向沉淀流程"
  • backlog.md §0.11"反向沉淀"
  • task #15 PoC 设计

SDD Step Gate

When specs/{REQUIREMENT_ID}/dashboard-state.json exists (SDD workflow active), after this command completes follow .harness/prompts/command-step-gate.md:

  1. Update dashboard-state.json and dashboard.html when applicable.
  2. Mark this command done, next step next, workflow_plan.phase = awaiting_user.
  3. Stop immediately - do not chain the next internal command in the same turn.
  4. Hand off with .harness/prompts/step-gate-handoff.md.

Skip only for standalone invocation without dashboard state, or when the user explicitly asks to batch remaining steps.

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. 8d ago First seen · 101 lines · 0 tokens per session scan A 1b6116cb7086

Subscribe to this mod's changes

harness.upstream is a command published in the GitHub repository hahaxiang27/FlowHarness (4 stars, last pushed 2mo ago), licensed MIT. It adds 54 tokens to every session and 1,509 once invoked, about $0.0003 per session on Opus 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-08-31.