<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: frcoder</title>
    <description>The latest articles on DEV Community by frcoder (@frcoderlh).</description>
    <link>https://dev.to/frcoderlh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4185824%2F60de3b99-0dc8-4067-9135-78d151d16783.jpg</url>
      <title>DEV Community: frcoder</title>
      <link>https://dev.to/frcoderlh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/frcoderlh"/>
    <language>en</language>
    <item>
      <title>[Harness Programming] Building AI Programming Workflow: Design Principles and Implementation Guidelines</title>
      <dc:creator>frcoder</dc:creator>
      <pubDate>Fri, 06 Nov 2026 06:06:55 +0000</pubDate>
      <link>https://dev.to/frcoderlh/harness-programming-building-ai-programming-workflow-design-principles-and-implementation-4ko2</link>
      <guid>https://dev.to/frcoderlh/harness-programming-building-ai-programming-workflow-design-principles-and-implementation-4ko2</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This document is for engineers designing and building AI-assisted coding workflows for individuals or teams.&lt;br&gt;
The reference implementation comes from the open-source project &lt;a href="https://frcoder.zz.ac/tack-harness/" rel="noopener noreferrer"&gt;Tack Harness&lt;/a&gt; and can be adapted as needed. Full source code: &lt;a href="https://github.com/frcoder-lh/tack-harness" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  1. Assessment Before Design
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1.1 A Basic Assessment
&lt;/h3&gt;

&lt;p&gt;Coding agents such as Claude Code, Cursor, TRAE, and Codex impose some constraints on large language models, but they still cannot replace harness engineering for software development. A coding workflow tailored to your needs can capture specialized knowledge and personal coding preferences while providing clearer, more visible guidance to the model. The harness directly determines "what the model can see, what it can do, and whether its mistakes can be detected." As model capabilities converge, harness design quality often becomes the deciding factor in system reliability.&lt;/p&gt;

&lt;p&gt;A harness must answer five questions: what the model sees at each decision point (context), which actions it may take (tools), which actions are prohibited by default (constraints), how to judge whether the result is correct (verification), and how to recover when an error is found (correction). The system must be able to do the work and be constrained to do it as intended.&lt;/p&gt;

&lt;p&gt;You can draw on the design principles of &lt;a href="https://github.com/frcoder-lh/tack-harness" rel="noopener noreferrer"&gt;Tack Harness&lt;/a&gt;: fixed processes (use scripts for anything scripts can accomplish), extensible capabilities (adding a Markdown file registers a capability), traceable state (&lt;code&gt;status.yaml&lt;/code&gt; is the only state-bearing file), isolated changes (worktrees isolate individual requirements), and accumulated experience (automatically codify practices as commands or rules when a task ends).&lt;/p&gt;

&lt;h3&gt;
  
  
  1.2 Three Boundaries
&lt;/h3&gt;

&lt;p&gt;Before creating directories, clarify these three boundaries:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Primary problem&lt;/strong&gt;: Identify the most pressing pain point. Common examples include missing project context across sessions, inconsistent development processes, and an inability to reuse past experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decision authority&lt;/strong&gt;: Specify which operations the model may perform automatically and which require human involvement. Typical human checkpoints include branch merges, releases, task-directory deletion, and writes to a shared knowledge base.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scope of use&lt;/strong&gt;: Decide whether the workflow serves an individual or a team. Individual workflows can iterate quickly; team workflows must support upgrades, reviews, and handoffs.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  1.3 Controlling Complexity
&lt;/h3&gt;

&lt;p&gt;Start with the simplest solution and add abstractions only when necessary. Every additional layer of indirection creates another blind spot for future debugging. If a few extra lines in a prompt solve the problem, do not introduce a new script. Consider turning a process into a command only after it has repeated more than three times across two tasks.&lt;/p&gt;

&lt;p&gt;Follow a minimum viable approach: address the primary pain point first, then expand the modules after two weeks of actual use. Avoid codifying an entire development process before validating any pain points.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Directory Skeleton
&lt;/h2&gt;

&lt;p&gt;The workflow's physical structure consists of five directories with distinct responsibilities and one persistent instruction file. The following is the directory layout used by Tack Harness:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-project/
├── AGENTS.md            # Persistent instructions: command routing + core constraints + data sources
├── tack.yaml            # Space registry: version, projects (keyword/repository mappings), workspace list
├── harness/             # Development process definitions (requirement-independent, customizable, three-way upgrade comparison)
│   ├── README.md        #   Harness usage guide
│   ├── cmd/             #   Commands: discovery, routing, entry and exit criteria
│   ├── agents/          #   Delegatable roles: parallel execution with independent contexts (explorer/architect/reviewer)
│   ├── workflow/        #   Workflows: state machines and command orchestration
│   ├── script/          #   Fixed-process scripts (invoked through the run.ps1 launcher on Windows)
│   │   └── hook/        #   Optional IDE hook acceleration layer (disabled by default, no interception)
│   ├── rule/            #   Business, code, and security rules (excluded from routing, loaded on demand)
│   ├── template/        #   Templates for commands, workflows, documents, and workspaces
│   └── reference/       #   General methodologies and complex standalone capabilities (distributed with the harness, no project-specific knowledge)
├── wiki/                # Shared knowledge: project-isolated wikis
│   └── &amp;lt;project&amp;gt;/       #   Project wiki (indexes + small files)
├── space/               # Workspaces: one directory per piece of work (&amp;lt;YYYYMMDD&amp;gt;-&amp;lt;branch-name&amp;gt;)
├── repo/                # Main code repositories: one copy only, used as a read-only baseline
└── .tack/               # Local framework runtime data (gitignored, not committed, can be cleared at any time)
    ├── log/             #   Logs
    ├── backup/          #   Rollback backups
    ├── tmp/             #   Temporary files
    └── state/           #   Local machine state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Table 2-1 lists each directory's responsibilities and prohibited contents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table 2-1. Directory Responsibilities&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Directory&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;th&gt;Prohibited contents&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Routing entry point, global hard constraints, and pointers to data locations&lt;/td&gt;
&lt;td&gt;Structured registries such as project and workspace lists&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tack.yaml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Structured registry: version, project names, keywords, repository mappings, and workspace list&lt;/td&gt;
&lt;td&gt;Free-form prose&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;harness/cmd/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Business-independent command manuals&lt;/td&gt;
&lt;td&gt;Business knowledge, code, and task progress&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;harness/workflow/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;State-machine definitions and command orchestration&lt;/td&gt;
&lt;td&gt;Execution details of individual commands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;harness/agents/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Delegatable role definitions (parallel execution with independent contexts)&lt;/td&gt;
&lt;td&gt;Participation in command routing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;harness/script/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Deterministic mechanical operations (batch Git operations, state updates, routing scans)&lt;/td&gt;
&lt;td&gt;Logic that requires semantic judgment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;harness/rule/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Coding standards, security boundaries, and read/write discipline&lt;/td&gt;
&lt;td&gt;Task-specific content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;harness/template/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Templates for commands, workflows, and documents&lt;/td&gt;
&lt;td&gt;Bodies of specific commands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;harness/reference/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;General methodologies and complex standalone capabilities&lt;/td&gt;
&lt;td&gt;Project-specific accumulated knowledge (overwritten during upgrades)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wiki/&amp;lt;project&amp;gt;/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stable knowledge shared across tasks&lt;/td&gt;
&lt;td&gt;Frequently changing code logic and one-off task details&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;space/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Artifacts and state for a single task&lt;/td&gt;
&lt;td&gt;Knowledge that must be retained across tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;repo/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read-only code baseline&lt;/td&gt;
&lt;td&gt;Direct code modifications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.tack/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Framework runtime data&lt;/td&gt;
&lt;td&gt;Any manual edits&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  2.1 Two-Layer Git Boundary
&lt;/h3&gt;

&lt;p&gt;The space root (&lt;code&gt;AGENTS.md&lt;/code&gt;, &lt;code&gt;harness/&lt;/code&gt;, &lt;code&gt;wiki/&lt;/code&gt;, and working documents under &lt;code&gt;space/&lt;/code&gt;) and the business code repositories use separate Git repositories. The framework automatically commits changes to the space-root repository at each command stage, so users do not need to operate it. Users perform Git operations such as commits and pushes only inside the workspace code repository at &lt;code&gt;space/&amp;lt;YYYYMMDD&amp;gt;-&amp;lt;branch-name&amp;gt;/repo/&lt;/code&gt;. This boundary keeps the workflow's evolution history separate from the business code history.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Persistent Instructions in AGENTS.md
&lt;/h2&gt;

&lt;p&gt;This is the first document the model loads in every session, so its length must be tightly controlled. Context-window capacity is scarce: every extra line of rarely used information adds token costs to every session. The persistent layer should contain only three kinds of content: command routing, global hard constraints, and pointers to data locations. A reference structure follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Persistent Project Instructions&lt;/span&gt;

&lt;span class="gu"&gt;## Command Routing&lt;/span&gt;
Upon receiving a user request, run &lt;span class="sb"&gt;`harness/script/scan-routes.sh resolve "&amp;lt;input&amp;gt;"`&lt;/span&gt;:
&lt;span class="p"&gt;-&lt;/span&gt; Single match: read the corresponding command file and follow it
&lt;span class="p"&gt;-&lt;/span&gt; Multiple matches: list the candidates and wait for the user to choose
&lt;span class="p"&gt;-&lt;/span&gt; No match: respond directly and suggest creating a command if necessary

&lt;span class="gu"&gt;## Global Constraints&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Modify code only inside space/&lt;span class="nt"&gt;&amp;lt;current-workspace&amp;gt;&lt;/span&gt;/repo/; never modify repo/ directly
&lt;span class="p"&gt;-&lt;/span&gt; Prohibit git push --force, git commit --no-verify, and git reset --hard
&lt;span class="p"&gt;-&lt;/span&gt; Record task progress in space/&lt;span class="nt"&gt;&amp;lt;workspace&amp;gt;&lt;/span&gt;/status.yaml; do not infer it from conversational memory
&lt;span class="p"&gt;-&lt;/span&gt; Before writing to the wiki, read its existing index; merge into an existing file on the same topic instead of creating fragments

&lt;span class="gu"&gt;## Data Locations&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Workspaces: space/&lt;span class="nt"&gt;&amp;lt;YYYYMMDD&amp;gt;&lt;/span&gt;-&lt;span class="nt"&gt;&amp;lt;branch-name&amp;gt;&lt;/span&gt;/
&lt;span class="p"&gt;-&lt;/span&gt; Project knowledge: wiki/&lt;span class="nt"&gt;&amp;lt;project-name&amp;gt;&lt;/span&gt;/
&lt;span class="p"&gt;-&lt;/span&gt; Command manuals: harness/cmd/
&lt;span class="p"&gt;-&lt;/span&gt; Status queries: harness/script/work-status.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Structured data such as project names, service-to-repository mappings, and workspace lists should be stored in &lt;code&gt;tack.yaml&lt;/code&gt; and read on demand through &lt;code&gt;harness/script/project.sh&lt;/code&gt;. The criterion is simple: is this information needed at every decision point in every session? If yes, put it in the persistent layer; otherwise, put it in the on-demand layer.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. A Three-Layer Memory System
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.1 Why Layers Are Necessary
&lt;/h3&gt;

&lt;p&gt;Putting all information into a single instruction file creates three problems: context costs grow linearly with project size; the model struggles to locate key constraints in long text; and information with different lifecycles gets mixed together—temporary state is treated as a long-term rule, while long-term knowledge is treated as a one-off detail.&lt;/p&gt;

&lt;p&gt;A better approach is to divide memory into three layers by lifecycle. Each layer has a different information format, read/write frequency, and loading method.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.2 Layer One: Session Trace
&lt;/h3&gt;

&lt;p&gt;User inputs, model responses, and tool-call results generated within a single session form its execution trace, which is discarded when the session ends. This layer does not require persistence; the model's context window carries it naturally. This workflow adds no further design for this layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.3 Layer Two: Workspace Short-Term Memory
&lt;/h3&gt;

&lt;p&gt;Each task has its own directory, &lt;code&gt;space/&amp;lt;YYYYMMDD&amp;gt;-&amp;lt;branch-name&amp;gt;/&lt;/code&gt;, which records the task's process state. Initially, create only two files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;status.yaml&lt;/code&gt;: the only state-bearing file, recording the current stage, active tasks, and next steps;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;context.md&lt;/code&gt;: original requirements (multiple entries may be appended in batches), reference links, and constraints.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Create the remaining directories (&lt;code&gt;story/&lt;/code&gt;, &lt;code&gt;doc/&lt;/code&gt;, &lt;code&gt;run/&lt;/code&gt;, and &lt;code&gt;repo/&lt;/code&gt;) on demand when the first file is produced or a worktree is checked out; do not pre-create empty directories. This layer represents "task-level business state": it tells the model "where we are and what to do next," so an interrupted task can resume in a new session without starting from scratch.&lt;/p&gt;

&lt;p&gt;Table 4-1 lists recommended fields for &lt;code&gt;status.yaml&lt;/code&gt;. Structured fields are preferable to free text because scripts must read and write this data atomically. Task claiming, state transitions, and progress aggregation are all handled by scripts, so the fields must be stable and parseable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table 4-1. Recommended status.yaml Fields&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;status&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Workflow state (initialized / planning / developing / reviewing / merged / blocked, etc.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;workflow&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Associated workflow (development / testing / bugfix / merge-conflict / branch-op)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;branch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Git branch name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;project&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Project name, which determines the wiki read/write path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tasks[]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Task list: id, title, module, repository, dependencies, acceptance criteria, and status&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;deploy[]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Deployment registry: repository, environment, lane, route, version, and status&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;guidance[]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;User guidance records (pending / applied / rejected; see Chapter 8)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;log[]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stage-transition log&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  4.4 Layer Three: Project Long-Term Memory
&lt;/h3&gt;

&lt;p&gt;Stored under &lt;code&gt;wiki/&amp;lt;project-name&amp;gt;/&lt;/code&gt;, this layer holds stable knowledge reusable across tasks. Use "paragraph-based documents with sources": explanations of business terms, the background and rationale of technical decisions, and service deployment addresses all need narrative context and should not be split into isolated key-value pairs.&lt;/p&gt;

&lt;p&gt;Table 4-2 lists recommended categories. Each category directory has an &lt;code&gt;index.md&lt;/code&gt; as its main index.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table 4-2. Recommended Project Wiki Categories&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category directory&lt;/th&gt;
&lt;th&gt;Contents&lt;/th&gt;
&lt;th&gt;Corresponding memory type&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;biz/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Business background, terminology, domain responsibilities, and invariants&lt;/td&gt;
&lt;td&gt;Semantic memory: business knowledge distilled from specific requirements&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;code/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Repository overviews, mappings from terms to code entry points, mappings from interfaces to business scenarios, and long-term analyses&lt;/td&gt;
&lt;td&gt;Semantic memory: stable navigation anchors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rule/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Technical decision records, engineering conventions, and preferences&lt;/td&gt;
&lt;td&gt;Semantic memory: why decisions were made&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;config/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Service inventory, deployment environments, lanes, gateway addresses, tenant accounts, and ways to obtain credentials&lt;/td&gt;
&lt;td&gt;Semantic memory: operational facts outside the code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;history/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Archived summaries of closed workspaces (summary.md + run/)&lt;/td&gt;
&lt;td&gt;Episodic memory: compressed archives of specific events&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Note the relationship between categories and memory types: process artifacts under &lt;code&gt;space/&lt;/code&gt; are &lt;strong&gt;episodic memory&lt;/strong&gt; (what happened during this task); knowledge accumulated under &lt;code&gt;wiki/&lt;/code&gt; is &lt;strong&gt;semantic memory&lt;/strong&gt; (what the project's business rules are); and commands and state machines under &lt;code&gt;harness/&lt;/code&gt; are &lt;strong&gt;procedural memory&lt;/strong&gt; (how this kind of work should be done). Keep these separate. Sending episodic memory directly into the long-term knowledge base without distillation contaminates the semantic layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.5 Indexes and Small Files
&lt;/h3&gt;

&lt;p&gt;The long-term knowledge base uses an "index + small files" structure. Each category directory contains an &lt;code&gt;index.md&lt;/code&gt; with a table listing files, topics, and coverage. The index is for navigation only and does not duplicate the body text. Split content into small, topic-specific files with high cohesion and low coupling.&lt;/p&gt;

&lt;p&gt;The engineering rationale is the limited context window: retrieval should begin with the index to identify the right direction, then read only the relevant sections. One file per topic reduces token costs for each read and keeps files maintainable over time.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.6 Write Discipline
&lt;/h3&gt;

&lt;p&gt;Follow these rules when writing information to the long-term knowledge base:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Write selectively.&lt;/strong&gt; Not everything in a conversation deserves long-term retention. Do not store one-off task details, such as "which account was used for this test"; retain only facts reusable across tasks. Before writing, ask: will another task need this information three months from now?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distill into general principles.&lt;/strong&gt; A specific user correction during a task ("do not write this function this way") should be distilled into a general rule ("functions of this kind in this project use pattern X") rather than piled up verbatim. A human must confirm this distillation to prevent the model from overgeneralizing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Include sources for every entry.&lt;/strong&gt; Each knowledge entry must identify its source: a workspace artifact (with file path and section), a user guidance record, a Git commit hash, or user-provided material. Reject content without a source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Classify confidence.&lt;/strong&gt; Entries have four confidence states: &lt;code&gt;confirmed&lt;/code&gt; (confirmed by the user or an authoritative source), &lt;code&gt;verified&lt;/code&gt; (cross-checked against code), &lt;code&gt;reported&lt;/code&gt; (stated by a single source), and &lt;code&gt;candidate&lt;/code&gt; (awaiting confirmation). Subsequent tasks load only the first two by default; the latter two serve only as leads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preserve evolution when resolving contradictions.&lt;/strong&gt; When a new fact conflicts with an existing entry, update it in place with the current conclusion and note "previously X, corrected on Y because of Z." When a technical decision is superseded, mark the relationship instead of deleting the old entry. This preserves the evolution of knowledge so later readers can understand why decisions changed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never use the knowledge base to update itself.&lt;/strong&gt; Facts used in knowledge-base updates may come only from original workspace artifacts, code, Git history, and original user-provided material. Existing knowledge-base pages must not serve as factual sources for updates to other pages. This prevents AI-generated content from being amplified through repeated internal references: an unverified statement, once stored, could otherwise be cited repeatedly until it appears to be an authoritative "consensus."&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  4.7 Retrieval Priority
&lt;/h3&gt;

&lt;p&gt;The model retrieves knowledge in the following order and must continue to lower layers when an upper layer lacks the information:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Project wiki (cross-task consensus) → current task's analysis documents (short-lived conclusions; validate the baseline commit) → direct code inspection (the ultimate source of truth)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If an upper layer is missing or questionable, descend to gather evidence; do not stop because "the knowledge base does not mention it." When knowledge-base content conflicts with code, the code takes precedence. Analysis documents should record a "baseline commit" in their headers. During subsequent retrieval, a script compares it with the current HEAD and warns that conclusions may be outdated if the baseline is several commits behind.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Command Representation and Routing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  5.1 Command File Structure
&lt;/h3&gt;

&lt;p&gt;Store commands as Markdown files under &lt;code&gt;harness/cmd/&lt;/code&gt; rather than hard-coding them into framework code. A command file is essentially an SOP for the model, specifying prerequisites, input sources, execution steps, and post-execution checks. Its front matter declares routing information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;spec&lt;/span&gt;          &lt;span class="c1"&gt;# Workflow files use workflow: development&lt;/span&gt;
&lt;span class="na"&gt;short&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sp&lt;/span&gt;
&lt;span class="na"&gt;triggers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;requirements planning, overall design, spec&lt;/span&gt;
&lt;span class="na"&gt;summary&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Produce a requirements specification&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The front matter has four fields: &lt;code&gt;command&lt;/code&gt; is the command name, &lt;code&gt;short&lt;/code&gt; is its abbreviation, &lt;code&gt;triggers&lt;/code&gt; lists Chinese and English trigger phrases separated by commas, and &lt;code&gt;summary&lt;/code&gt; is a one-sentence description. Organize the command body as "prerequisites → input sources → execution steps → post-execution checks."&lt;/p&gt;

&lt;p&gt;A workspace may contain multiple development stories. Organize analysis artifacts by story:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;space/20261001-user-login/
├── status.yaml
├── context.md
├── story/
│   └── &amp;lt;story&amp;gt;/
│       ├── analysis.md      # Requirements analysis: existing implementation, feasibility, compatibility, open questions
│       ├── spec.md          # Requirements specification (top-level design and shared contracts)
│       └── plan.md          # Development plan (detailed design and implementation blueprint)
├── doc/
│   ├── tech-design.md       # Technical review document (on demand)
│   ├── test.md              # System test plan (on demand)
│   ├── code-review.md       # Code review report (on demand)
│   ├── release-check.md     # Release checklist (on demand)
│   └── analysis/            # Code Q&amp;amp;A and analysis records before requirements are clarified
└── run/                     # Reusable execution instructions (on demand)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5.2 Routing Script
&lt;/h3&gt;

&lt;p&gt;Implement a companion routing script whose core responsibility is to scan all &lt;code&gt;.md&lt;/code&gt; files under &lt;code&gt;harness/cmd/&lt;/code&gt; and &lt;code&gt;harness/workflow/&lt;/code&gt;, parse their front matter, match trigger phrases against user input, and return matching file paths. Tack Harness defines these &lt;code&gt;scan-routes.sh&lt;/code&gt; subcommands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sh harness/script/scan-routes.sh list       harness   &lt;span class="c"&gt;# Workflow table + command table + delegatable role table&lt;/span&gt;
sh harness/script/scan-routes.sh workflows  harness   &lt;span class="c"&gt;# Workflows only (intent recognition)&lt;/span&gt;
sh harness/script/scan-routes.sh commands   harness   &lt;span class="c"&gt;# Commands only&lt;/span&gt;
sh harness/script/scan-routes.sh agents     harness   &lt;span class="c"&gt;# Delegatable roles only (excluded from routing)&lt;/span&gt;
sh harness/script/scan-routes.sh resolve    harness &lt;span class="s2"&gt;"requirements planning"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Behavior:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Single match&lt;/strong&gt;: output the command file path; the model loads and executes it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiple matches&lt;/strong&gt;: output a candidate list; the model asks the user to choose.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No match&lt;/strong&gt;: the model responds directly and suggests creating a command if necessary.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Perform scanning, parsing, and matching within a single script process to avoid forking multiple subprocesses per file on Windows. For English keywords, use word-boundary matching (the match must occur at the beginning of a word or after &lt;code&gt;-&lt;/code&gt; / &lt;code&gt;_&lt;/code&gt;); for Chinese keywords, use substring matching.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.3 Tool Interface Design Principles
&lt;/h3&gt;

&lt;p&gt;Commands and scripts are both tools the model can invoke. Tool interface quality directly affects the reliability of model behavior. Two principles deserve emphasis:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Design names and parameters from the model's perspective.&lt;/strong&gt; Command names should correspond to the way users describe their intent in natural language, and trigger phrases should cover common Chinese and English expressions. A command name that requires reverse engineering to understand is effectively invisible. All Tack Harness commands support Chinese and English trigger phrases and abbreviations, such as the Chinese equivalent of &lt;code&gt;requirements planning&lt;/code&gt;, &lt;code&gt;spec&lt;/code&gt;, and &lt;code&gt;sp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make incorrect usage difficult.&lt;/strong&gt; High-risk operations, such as deleting task directories, force-pushing, and overwriting the knowledge base, should be disabled by default at the tool level or require an explicit confirmation parameter. Do not rely on prompts telling the model "do not do this." Errors that are structurally impossible are prevented more reliably than errors prohibited only by prompt instructions.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. State Machines and Task Scheduling
&lt;/h2&gt;

&lt;h3&gt;
  
  
  6.1 State-Machine Definitions
&lt;/h3&gt;

&lt;p&gt;A major reason models fail on open-ended tasks is that they lack a clear understanding of the current stage. Define a state machine for each typical development scenario and store it under &lt;code&gt;harness/workflow/&lt;/code&gt;. Tack Harness defines five workflows:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Workflow&lt;/th&gt;
&lt;th&gt;Trigger phrases&lt;/th&gt;
&lt;th&gt;State transitions&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;development&lt;/td&gt;
&lt;td&gt;requirement development / feature development / dev&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;initialized → planning → developing → reviewing → merged&lt;/code&gt;; close deregisters the workspace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;testing&lt;/td&gt;
&lt;td&gt;add tests / testing task / tst&lt;/td&gt;
&lt;td&gt;&lt;code&gt;initialized → test-planning → testing → verifying → completed&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bugfix&lt;/td&gt;
&lt;td&gt;fix bug / fix defect / troubleshoot / bug&lt;/td&gt;
&lt;td&gt;&lt;code&gt;initialized → reproducing → diagnosing → fixing → verifying → completed&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;merge-conflict&lt;/td&gt;
&lt;td&gt;merge conflict / conflict workflow / mc&lt;/td&gt;
&lt;td&gt;&lt;code&gt;initialized → fetching → merging → resolving → verifying → pushing → completed&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;branch-op&lt;/td&gt;
&lt;td&gt;branch operation / bop&lt;/td&gt;
&lt;td&gt;&lt;code&gt;initialized → preparing → integrating (resolving on conflict) → pushing → completed&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Any blocked stage may enter the &lt;code&gt;blocked&lt;/code&gt; state, with the blocking reason recorded in &lt;code&gt;status.yaml&lt;/code&gt;. Once unblocked, it returns to the previous state. The main development path is:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    A["init"] --&amp;gt; B["work requirements"]
    B --&amp;gt; B2["analyze requirements analysis"]
    B2 --&amp;gt; C["spec"]
    C --&amp;gt; D["plan"]
    D --&amp;gt; E["tech-design"]
    E --&amp;gt; F["code"]
    F --&amp;gt; H["fetch"]
    H --&amp;gt; I["commit"]
    I --&amp;gt; J["push"]
    J --&amp;gt; K["merge"]
    K --&amp;gt; L["close"]
    B -. optional before requirements are clarified .-&amp;gt; A1["ask"]
    F -. triggered when requested by the user .-&amp;gt; G["testcode"]
    F -. triggered when requested by the user .-&amp;gt; G2["test"]
    F -. triggered when requested by the user .-&amp;gt; G3["run"]
    C &amp;amp; D &amp;amp; E &amp;amp; F -. deviation detected .-&amp;gt; M["fix"]
    M -. requirements correction loop .-&amp;gt; C
    K -. conflict .-&amp;gt; N["solve"]
    N -.-&amp;gt; K&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  6.2 Fix the Main Path, Delegate Within Boundaries
&lt;/h3&gt;

&lt;p&gt;The state machine is not intended to prescribe every step the model takes. It safeguards the boundaries of "which stages must be completed." The main path—requirements analysis → solution design → coding → review → merge—is constrained by the state machine, and stages cannot be skipped. Within each state, decisions such as "how to write this code" or "which solution to choose" are entirely up to the model.&lt;/p&gt;

&lt;p&gt;This balances workflows with autonomous agents: use state machines to constrain stages that can be decomposed into fixed steps, while preserving model autonomy in stages that require dynamic decisions.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.3 Task Scheduling
&lt;/h3&gt;

&lt;p&gt;The task list produced during &lt;code&gt;plan&lt;/code&gt; is written to &lt;code&gt;tasks[]&lt;/code&gt; in &lt;code&gt;status.yaml&lt;/code&gt;. Each entry includes &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;module&lt;/code&gt;, &lt;code&gt;repo&lt;/code&gt;, &lt;code&gt;deps&lt;/code&gt;, &lt;code&gt;acceptance&lt;/code&gt;, and &lt;code&gt;status&lt;/code&gt;. Scripts must claim and complete tasks atomically to prevent duplicate claims by parallel model instances:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify that dependencies are satisfied before setting a task to in progress.&lt;/li&gt;
&lt;li&gt;After completing the current task, return the next ready task.&lt;/li&gt;
&lt;li&gt;Support transitions among pending / in_progress / done / blocked.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6.4 On-Demand Commands
&lt;/h3&gt;

&lt;p&gt;Commands for testing, code review, and release checks should not be attached to the main path. They do not occupy workflow state slots or block the main process, and the model does not proactively ask whether to execute them. They are triggered only by explicit user requests. Tack Harness includes these on-demand commands: &lt;code&gt;testcode&lt;/code&gt; (unit-test-driven review of consistency between requirements and code), &lt;code&gt;test&lt;/code&gt; (system test plan), &lt;code&gt;run&lt;/code&gt; (reusable script execution), &lt;code&gt;code-review&lt;/code&gt; (an independent pre-merge review report), and &lt;code&gt;release-check&lt;/code&gt; (release checklist). This avoids forcing heavyweight processes onto simple tasks: a two-line change should not require the full testing and review process.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.5 Automatic Progression
&lt;/h3&gt;

&lt;p&gt;Provide an &lt;code&gt;auto&lt;/code&gt; command that executes all remaining stages of the current workflow until its terminal state. Before starting, collect all missing information and confirm the entire process once. After confirmation, proceed continuously without interruptions, then summarize key decisions and results. By default, stop at merged / completed; optionally include close.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Dividing Responsibilities Between Scripts and the Model
&lt;/h2&gt;

&lt;p&gt;The principle is: &lt;strong&gt;script all operations that can be performed deterministically; leave stages requiring semantic judgment to the model&lt;/strong&gt;. Table 7-1 shows typical assignments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Table 7-1. Responsibility Boundaries Between Scripts and the Model&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation type&lt;/th&gt;
&lt;th&gt;Executor&lt;/th&gt;
&lt;th&gt;Rationale&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Batch updates to state fields across files&lt;/td&gt;
&lt;td&gt;Script&lt;/td&gt;
&lt;td&gt;Mechanical, frequent, and precision-sensitive (&lt;code&gt;work-status.sh&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Batch Git add / commit / push / worktree management&lt;/td&gt;
&lt;td&gt;Script&lt;/td&gt;
&lt;td&gt;Frequent, error-prone, and requires atomicity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command-routing scans&lt;/td&gt;
&lt;td&gt;Script&lt;/td&gt;
&lt;td&gt;Required in every session and should not consume tokens (&lt;code&gt;scan-routes.sh&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Knowledge-base index integrity checks&lt;/td&gt;
&lt;td&gt;Script&lt;/td&gt;
&lt;td&gt;Machine-verifiable and must serve as a gate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Credential-pattern scanning&lt;/td&gt;
&lt;td&gt;Script&lt;/td&gt;
&lt;td&gt;High-confidence rules with manageable false positives (&lt;code&gt;scan-secrets.sh&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Workspace creation and batch directory registration&lt;/td&gt;
&lt;td&gt;Script&lt;/td&gt;
&lt;td&gt;Mechanical operations that ensure consistency&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Three-way upgrade comparison and baseline management&lt;/td&gt;
&lt;td&gt;Script&lt;/td&gt;
&lt;td&gt;Requires precise comparison between shipped originals and local changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Requirements decomposition and story partitioning&lt;/td&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;Requires semantic judgment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Technical solution selection&lt;/td&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;Requires context-aware tradeoffs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defect localization and hypothesis generation&lt;/td&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;Requires exploration and reasoning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Code review conclusions&lt;/td&gt;
&lt;td&gt;Model&lt;/td&gt;
&lt;td&gt;Requires function-by-function semantic judgment&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The underlying reasoning is that the model should freely combine general exploration capabilities, such as reading and writing files, running commands, and searching code. High-risk or strongly constrained operations, such as adding credentials to a repository, deleting branches, and force-pushing, should be encapsulated in dedicated scripts and disabled by default or require human confirmation. A useful criterion: if a prompt instruction describes a fixed sequence of actions, implement it as a script instead of relying on the model to follow it voluntarily every time.&lt;/p&gt;

&lt;p&gt;Scripts must be portable across Linux, macOS, and Windows Git Bash, and should uniformly use POSIX sh. In Tack Harness, &lt;code&gt;lint-shell-portability.sh&lt;/code&gt; runs as part of structural checks to detect bare &lt;code&gt;mktemp&lt;/code&gt;, GNU-specific options, bashisms, and sed dialect issues.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. The Experience-Capture Feedback Loop
&lt;/h2&gt;

&lt;p&gt;A workflow without an experience-capture mechanism will degrade into unconstrained conversation within weeks. Establish a three-step loop: "capture → codify → validate."&lt;/p&gt;

&lt;h3&gt;
  
  
  8.1 Capture
&lt;/h3&gt;

&lt;p&gt;During task execution, whenever the user corrects model behavior or adds a convention, append the original facts to the &lt;code&gt;guidance&lt;/code&gt; list in &lt;code&gt;status.yaml&lt;/code&gt;. Each record includes the time, stage, scenario description, the user's verbatim statement, and a status of pending (awaiting codification). At this stage, record facts only; do not generalize them or modify any rule files.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.2 Codify
&lt;/h3&gt;

&lt;p&gt;When the task ends, during the &lt;code&gt;close&lt;/code&gt; command, present the pending entries to the user for review. Review criteria: is this reusable across tasks? Is it a long-term rule or a one-off exception? After user confirmation, scan existing command and rule files. Merge into a related entry if one exists; create a new file only when no suitable entry exists. Mark user-rejected entries as rejected; leave undecided entries as pending.&lt;/p&gt;

&lt;p&gt;The key is "delayed judgment": record corrections when they occur, rather than immediately changing rules in the heat of the moment. Once the task ends and some distance is available, decide whether each correction belongs in a long-term rule or applies only to this task.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.3 Validate
&lt;/h3&gt;

&lt;p&gt;After saving the changes, a script verifies that the target file actually exists before marking the corresponding guidance entry as applied. If the path does not exist, block the write and report an error. This prevents accumulated guidance from pointing to nonexistent files.&lt;/p&gt;

&lt;h3&gt;
  
  
  8.4 Three Additional Paths
&lt;/h3&gt;

&lt;p&gt;In addition to the automatic loop, provide three manual commands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;record (manual knowledge capture)&lt;/strong&gt;: when the user asks to record knowledge, first scan existing commands and try to merge or amend them. Content may be stored in commands, workflows, rules, the wiki, or persistent constraints in AGENTS.md. When creating a command, only command is required; abbreviations and Chinese and English trigger phrases are generated automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;evolution (internal review)&lt;/strong&gt;: reconcile the space registry with actual directories, check wiki index integrity, lint framework structure and script signatures, review all instructions, identify candidates for rule/reference/script, and clean up outdated facts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;study (external learning)&lt;/strong&gt;: read the design of an external skill or repository, extract useful practices, and save them to the appropriate harness locations. Present a consolidated preview for confirmation before committing, then automatically run an incremental evolution.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  9. Binding Reviews to Evidence
&lt;/h2&gt;

&lt;p&gt;Code reviews and release checks need an evidence-fingerprint mechanism to address the problem of "inputs change after a review, but its conclusions are still reused."&lt;/p&gt;

&lt;p&gt;Before a review begins, compute a hash fingerprint of all review inputs, including requirements documents, rule files, repository HEAD, target branch reference, staged diff, unstaged diff, and the contents of untracked files. After completing the review, the reviewer must confirm the conclusion using the token returned by the script. The script recomputes the fingerprint and checks that the token matches before recording the review as complete. Any input change during the review causes a fingerprint mismatch and automatically invalidates the token.&lt;/p&gt;

&lt;p&gt;The same mechanism can confirm stages: after the user confirms requirements analysis, solution design, or another stage, store a receipt bound to the document hash. When resuming an interrupted task, reread only stage documents whose fingerprints have changed or which remain unconfirmed, avoiding a full reread.&lt;/p&gt;

&lt;p&gt;This mechanism turns the vague statement "I have read and approved it" into a machine-verifiable snapshot of facts.&lt;/p&gt;




&lt;h2&gt;
  
  
  10. Isolation and Safety Constraints
&lt;/h2&gt;

&lt;p&gt;The following mechanisms provide necessary safety boundaries at relatively low cost. They share one design principle: &lt;strong&gt;prevent errors structurally wherever possible, instead of relying on prompt reminders&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Code-change isolation&lt;/strong&gt;: treat the main &lt;code&gt;repo/&lt;/code&gt; as a read-only baseline and make task code changes in independent worktrees under &lt;code&gt;space/&amp;lt;workspace&amp;gt;/repo/&lt;/code&gt;. Multiple tasks can develop different requirements in parallel without interfering with one another. Accidental operations on the main repository are physically impossible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dangerous-operation prohibition&lt;/strong&gt;: explicitly prohibit operations such as &lt;code&gt;push --force&lt;/code&gt;, &lt;code&gt;commit --no-verify&lt;/code&gt;, &lt;code&gt;reset --hard&lt;/code&gt;, and direct modifications to the main repository in &lt;code&gt;harness/rule/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Space-level mutual exclusion&lt;/strong&gt;: serialize state writes and automatic commits to the space-root repository using a space lock. If the lock-holding process is killed or interrupted, reclaim the leftover lock automatically by checking whether its PID is alive; a living lock holder continues to block other processes normally.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Credential-scanning gate&lt;/strong&gt;: run &lt;code&gt;scan-secrets.sh&lt;/code&gt; before committing documents to match high-confidence credential patterns, such as private-key headers, cloud-provider access keys, and token prefixes. A match blocks the automatic commit. Placeholder values (&lt;code&gt;your-&lt;/code&gt;, &lt;code&gt;example&lt;/code&gt;, and &lt;code&gt;&amp;lt;...&amp;gt;&lt;/code&gt; templates) and explicit exemption markers do not trigger alerts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Directory-deletion validation&lt;/strong&gt;: before deleting a workspace directory, perform three checks: the path must be a single-level directory name (reject separators and &lt;code&gt;..&lt;/code&gt;); its physical path must be confirmed to lie inside &lt;code&gt;space/&lt;/code&gt; (prevent symlink escapes); and no worktrees may remain under &lt;code&gt;repo/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branch-cleanup gate&lt;/strong&gt;: close processes only branches registered in &lt;code&gt;status.yaml&lt;/code&gt; and defaults to dry-run. Branches not merged into the main branch, protected branches, branches occupied by worktrees, and entries with an unknown mainline are listed but not deleted. Remote branches are not deleted automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human approval checkpoints&lt;/strong&gt;: branch merges, releases, and workspace deletion require explicit user confirmation. Commits are triggered by the user invoking the commit command; invoking it confirms intent, and the commit is made directly after its message is generated automatically.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  11. Organizing Reusable Scripts
&lt;/h2&gt;

&lt;p&gt;Organize repeated operations such as testing and data migration into dedicated instruction directories instead of writing temporary scripts each time. A recommended structure follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;space/20261001-user-login/run/
├── run.md              # Guide: purpose, dependencies, manual-step instructions (identification, indexing, and orchestration only)
├── &amp;lt;instruction-1&amp;gt;/
│   ├── setup.sh        # Implementation scripts
│   ├── load-data.sh
│   └── local/          # Credentials and environment data (gitignored, excluded from version control)
└── &amp;lt;instruction-2&amp;gt;/
    └── ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;run.md&lt;/code&gt; handles identification, indexing, and orchestration only. Each instruction has its own directory for scripts, data, and credentials (&lt;code&gt;local/&lt;/code&gt; is excluded from version control). During execution, verify checklist completeness, execute in order, stop on failure, and support explicit resumption and confirmation of manual steps. When the task closes, archive the entire &lt;code&gt;run/&lt;/code&gt; directory under &lt;code&gt;wiki/&amp;lt;project&amp;gt;/history/&amp;lt;workspace&amp;gt;/&lt;/code&gt; so its scripts can be reused directly in later work.&lt;/p&gt;




&lt;h2&gt;
  
  
  12. Implementation Roadmap
&lt;/h2&gt;

&lt;p&gt;Implement the workflow in stages:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week one&lt;/strong&gt;: create only &lt;code&gt;AGENTS.md&lt;/code&gt; and the three most frequently used commands (start a task, write code, and commit/wrap up). Maintain the YAML state file manually. Run the full process on one real requirement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Weeks two through four&lt;/strong&gt;: add capabilities gradually based on pain points revealed by actual use. For example, write a state-update script if manual status changes are frequent; add indexing rules and an integrity-check script if the knowledge base becomes disorganized; promote a constraint to &lt;code&gt;AGENTS.md&lt;/code&gt; if the model repeatedly violates it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Month two&lt;/strong&gt;: enable the experience-capture loop. By then, enough user correction records should have accumulated to provide material for codifying rules. Also introduce evidence fingerprints and isolated worktrees to address the reliability of parallel tasks and code reviews.&lt;/p&gt;

&lt;p&gt;Do not pursue process completeness before gaining practical experience. Let the workflow grow from real pain points rather than designing it all in advance. Model capabilities continue to evolve: a stage that needs a script safeguard today may become a native model capability tomorrow. Keep the workflow lean and reserve its complexity budget for work the model still cannot handle reliably.&lt;/p&gt;




&lt;h2&gt;
  
  
  Appendix: Minimum Viable Version
&lt;/h2&gt;

&lt;p&gt;The following structure can be set up in half an hour:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-project/
├── AGENTS.md                  # Persistent instruction file of about 30 lines
├── tack.yaml                  # Empty project registry
├── harness/
│   ├── cmd/
│   │   ├── work.md            # Create a workspace: create directories, write status.yaml and context.md
│   │   ├── code.md            # Coding: execute the plan
│   │   └── close.md           # Commit and wrap up: archive, capture knowledge, and clean up
│   ├── workflow/
│   │   └── development.md     # State machine for the main path
│   ├── script/
│   │   └── scan-routes.sh     # Command routing (about 100 lines)
│   └── rule/
│       └── security.md        # Three prohibitions
├── wiki/
│   └── &amp;lt;project&amp;gt;/
│       └── index.md
└── space/                     # Workspace directories are created on demand
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you prefer not to start from scratch, adapt TackHarness directly. Full source code: &lt;a href="https://github.com/frcoder-lh/tack-harness" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. After two weeks of use on real tasks, iterate and expand based on the specific problems encountered, until the workflow matches the actual development habits of your individual or team.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing TackHarness
&lt;/h3&gt;

&lt;p&gt;Choose either method below.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Let the agent install it (recommended). Enter the following in a coding agent such as Claude Code, Cursor, TRAE, or Codex:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Install this skill: https://github.com/frcoder-lh/tack-harness
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Use the one-command installation script. Enter the following in a shell terminal:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/frcoder-lh/tack-harness/master/install.sh | sh &lt;span class="nt"&gt;-s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using TackHarness
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Initialize a TackHarness space
/tack

# View help
/tack help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the detailed workflow, see: &lt;a href="https://github.com/frcoder-lh/tack-harness#4-%E4%BD%BF%E7%94%A8%E6%B5%81%E7%A8%8B" rel="noopener noreferrer"&gt;https://github.com/frcoder-lh/tack-harness#4-usage-workflow&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>programming</category>
    </item>
    <item>
      <title>Tack Harness</title>
      <dc:creator>frcoder</dc:creator>
      <pubDate>Thu, 15 Oct 2026 12:55:52 +0000</pubDate>
      <link>https://dev.to/frcoderlh/tack-harness-14cf</link>
      <guid>https://dev.to/frcoderlh/tack-harness-14cf</guid>
      <description>&lt;p&gt;&lt;a href="https://frcoder.zz.ac/tack-harness/" rel="noopener noreferrer"&gt;Tack Harness&lt;/a&gt;: A Minimalist, Agent-Driven Framework for Disciplined Software Engineering&lt;/p&gt;

&lt;p&gt;As software engineers, we often find ourselves drowning in tooling complexity. Modern development frameworks promise to make us faster, yet we spend half our time configuring pipelines, wrangling bloated abstractions, and trying to keep our AI assistants from hallucinating across massive, unstructured codebases.&lt;/p&gt;

&lt;p&gt;What if we returned to something lean, restrained, and profoundly disciplined?&lt;/p&gt;

&lt;p&gt;Enter Tack Harness—a minimalist programming workflow framework designed to bring absolute clarity, determinism, and robust agent collaboration to software development. Whether you are coding solo or orchestrating specialized AI agents, Tack Harness provides the rails you need to build reliable software without the bloat.&lt;/p&gt;

&lt;p&gt;In this post, we will explore why Tack Harness was built, its core architectural principles, how its finite state machine keeps development on track, and how its agent delegation model changes the way we collaborate with AI.&lt;/p&gt;

&lt;p&gt;The Philosophy: Lean and Restrained&lt;/p&gt;

&lt;p&gt;Tack Harness isn’t trying to do everything for you. Instead, it acts as a lightweight harness that enforces a strict, predictable development rhythm. By keeping the workflow constrained and intentional, it eliminates decision fatigue and ensures that every change is traceable, isolated, and correct.&lt;/p&gt;

&lt;p&gt;The framework rests upon 5 Core Principles, affectionately known as the FETID pillars (though much more pleasant to work with than the acronym suggests):&lt;/p&gt;

&lt;p&gt;Fixable: Every component and workflow state must be transparent and straightforward to debug. If something breaks, the path to remediation should be immediately obvious.&lt;/p&gt;

&lt;p&gt;Extensible: Built with a modular mindset, Tack Harness lets you plug in custom tools, skills, and agents without rewriting core logic.&lt;/p&gt;

&lt;p&gt;Traceable: Nothing happens in a black box. Actions, state transitions, and agent decisions leave a clean, auditable trail.&lt;/p&gt;

&lt;p&gt;Isolated: Tasks, branches, and execution environments are kept separate to prevent unintended side effects from bleeding across your project.&lt;/p&gt;

&lt;p&gt;Distilled: Stripped of unnecessary boilerplate. Every abstraction serves an immediate, practical purpose.&lt;/p&gt;

&lt;p&gt;The 5 Core Workflow States&lt;/p&gt;

&lt;p&gt;Traditional development often feels chaotic because we jump haphazardly between writing code, fixing tests, resolving conflicts, and managing branches. Tack Harness models the development lifecycle as a deterministic Finite State Machine (FSM) consisting of 5 distinct states:&lt;/p&gt;

&lt;p&gt;Development (development): The sandbox where active feature building happens under strict guidelines.&lt;/p&gt;

&lt;p&gt;Testing (testing): Rigorous validation to ensure changes meet quality bars before progression.&lt;/p&gt;

&lt;p&gt;Bugfix (bugfix): A dedicated, focused state for diagnosing and patching regressions without distraction.&lt;/p&gt;

&lt;p&gt;Merge-Conflict (merge-conflict): A systematic protocol for handling divergent changes safely and cleanly.&lt;/p&gt;

&lt;p&gt;Branch-Op (branch-op): Standardized handling of branch lifecycles, synchronization, and cleanup.&lt;/p&gt;

&lt;p&gt;By enforcing these states, Tack Harness prevents premature merging, sloppy testing, and orphaned branches.&lt;/p&gt;

&lt;p&gt;Empowering AI with Skill and AGENTS.md&lt;/p&gt;

&lt;p&gt;One of the standout features of Tack Harness is its native support for agent-driven workflows. Instead of treating AI as a generic chat window, Tack Harness treats AI agents as specialized team members governed by explicit context.&lt;/p&gt;

&lt;p&gt;The AGENTS.md Contract&lt;/p&gt;

&lt;p&gt;Every project using Tack Harness can define an AGENTS.md file. This acts as the constitutional document for AI agents operating within your repository. It outlines project rules, coding standards, architectural boundaries, and behavioral expectations, ensuring that any AI tool working on your codebase respects your conventions from the first line to the last.&lt;/p&gt;

&lt;p&gt;Modular Skill System&lt;/p&gt;

&lt;p&gt;Skills encapsulate discrete capabilities that agents can load and execute. Whether it is parsing a complex AST, running a specific validation suite, or formatting documentation, skills keep agent logic modular and reusable.&lt;/p&gt;

&lt;p&gt;Role Delegation: Meet Your AI Squad&lt;/p&gt;

&lt;p&gt;Instead of relying on a single, monolithic prompt to do everything, Tack Harness introduces a clean Role Delegation Model. Different phases of development require different mindsets:&lt;/p&gt;

&lt;p&gt;code-explorer: The scout. This agent navigates the codebase, maps dependencies, traces call stacks, and gathers context without altering code. Perfect for onboarding or understanding legacy modules.&lt;/p&gt;

&lt;p&gt;code-architect: The planner. Once the landscape is clear, the architect designs the solution, defines interfaces, and outlines step-by-step implementation plans aligned with the project's core principles.&lt;/p&gt;

&lt;p&gt;code-reviewer: The gatekeeper. Before any code is finalized, the reviewer inspects the diff against project standards, checks for edge cases, security flaws, and style violations, ensuring high code hygiene.&lt;/p&gt;

&lt;p&gt;By separating exploration, architecture, and review, you get significantly higher-quality outputs from your AI tools and a much smoother review process for human maintainers.&lt;/p&gt;

&lt;p&gt;Getting Started&lt;/p&gt;

&lt;p&gt;Ready to bring discipline and seamless agent collaboration to your workflow?&lt;/p&gt;

&lt;p&gt;You can check out the official repository and documentation to explore the reference implementation, configuration templates, and setup guides:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/frcoder-lh/tack-harness" rel="noopener noreferrer"&gt;Tack Harness on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Give it a spin on your next project, embrace the restrained workflow, and let your AI agents work smarter, not harder. Happy coding!&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>softwareengineering</category>
    </item>
  </channel>
</rss>
