| name | impl |
| version | 0.4.0 |
| description | Autonomous implementation engine (the "harnish" engine). PRD to task decomposition, ralph loop autonomous execution, cross-session context preservation, experience accumulation. Triggers: "impl", "harnish", "harnish ์์", "harnish ๋๋ ค", "harnish ์ด์ด์", "๊ตฌํ ์์", "start implementation", "ํ์คํฌ ๋ถํด", "decompose tasks", "๋ฃจํ ๋๋ ค", "run loop", "์ด์ด์ ์งํ", "continue", "๋ค์ ํ์คํฌ", "next task", "์งํ ์ํ", "progress status", "์์ฐ ํํฉ", "asset status", "์์ฐ ์์ถ", "compress assets", "์ด ํจํด ๊ธฐ์ตํด", "remember this pattern", "์คํฌ๋ก ๋ง๋ค์ด", "make it a skill", Request to resume work when harnish-current-work.json exists.
|
| ssl | {"logical":{"writes":["harnish-current-work.json",".harnish/assets/*.jsonl","project files (current task scope)","docs/session-*.md"],"idempotent":false,"resumable":true,"rollback":"Hard guardrails STOP loop; 3-failure rule halts task; ceremony_done flag prevents re-fire; deleting harnish-current-work.json is a hard guardrail"}} |
impl โ Autonomous Implementation Engine (the "harnish" engine)
Do not judge. Follow the rules. When lost, return to harnish-current-work.json. When stuck, escalate. No invention.
Skill Chain
drafti-architect (or drafti-feature) โ impl โ galmuri:ralphi (sibling plugin)
| Skill | Standalone Call | Prerequisites |
|---|
| drafti-architect | Yes | None (only needs a technical problem) |
| drafti-feature | Yes | Requires a planning document |
| impl | Yes | docs/prd-*.md or existing harnish-current-work.json |
| galmuri:ralphi | Yes (external) | Specify target files/directories to verify |
When harnish starts without a PRD: "No PRD found. Please create one first with /drafti-architect or /drafti-feature."
Bash Convention
bash 3.2+, python3 (3.14+). macOS/Linux. No jq required as of v0.1.0.
Each Bash tool invocation is a fresh subshell โ variables do not survive across calls. Every bash block in this skill must re-declare HARNISH_ROOT="${CLAUDE_PLUGIN_ROOT}" inline before using any script path. There are no persistent script-name aliases; full paths ($HARNISH_ROOT/scripts/{name}.sh) are used directly.
State counters (TASK_COMPLETE_COUNT, etc.) are tracked by the LLM in conversation memory, not in shell variables. COMPRESS_EVERY_N = 5.
Entry Check
If invoked with no context (no PRD path, no task description, no experience command, no harnish-current-work.json in CWD):
โ Ask: "๋ฌด์์ ๊ตฌํํ ๊น์? PRD ํ์ผ ๊ฒฝ๋ก๋ ์์
๋ด์ฉ์ ์๋ ค์ฃผ์ธ์."
โ Wait for user response before proceeding to Step 1.
Step 1: Mode Detection
| Condition | Mode | Next | References to Load |
|---|
| PRD provided, no harnish-current-work.json | Seeding | Step 2 | task-schema.md + progress-template.md |
| harnish-current-work.json exists | Implementation Loop | Step 3 | escalation-protocol.md + guardrail-levels.md |
| "์์ฐ ํํฉ/์์ถ/๊ธฐ์ตํด/์คํฌ๋ก" | Experience | Step 5 | thresholds.md |
| harnish-current-work.json exists + session start | Restore | Step 4 | โ |
Load at most 2 references at a time. (See Context Budget below.)
Note: references/retention-policy.md is not auto-loaded by any utterance โ it documents an out-of-band ops flow (scripts/purge-assets.sh, asset deletion). It is referenced only on explicit ์์ฐ ๋ณด์กด ์ ์ฑ
/ asset retention policy utterance per Step 5.
Step 2: Seeding (PRD โ harnish-current-work.json)
- Verify PRD file:
docs/prd-{name}.md. Confirm existence of ยง4 (Implementation Spec), ยง6 (Tests), ยง7 (Guardrails)
- Query existing assets:
HARNISH_ROOT="${CLAUDE_PLUGIN_ROOT}"
bash "$HARNISH_ROOT/scripts/query-assets.sh" \
--tags "{key}" --types guardrail --format text \
--base-dir "$(pwd)/.harnish"
- Phase splitting: Data โ Business Logic โ UI โ Integration Tests
- Task decomposition: 1 task = 1 file | 1 function | 1 test | 1 config
- Read
references/progress-template.md and generate harnish-current-work.json โ validate:
HARNISH_ROOT="${CLAUDE_PLUGIN_ROOT}"
bash "$HARNISH_ROOT/scripts/validate-progress.sh" .harnish/harnish-current-work.json
- Report to user: "Seeding complete โ {N} Phases, {M} Tasks โ review and say 'run loop'"
- โ Proceed to Step 3
Step 3: Implementation Loop (ralph)
Entry
HARNISH_ROOT="${CLAUDE_PLUGIN_ROOT}"
bash "$HARNISH_ROOT/scripts/validate-progress.sh" .harnish/harnish-current-work.json
bash "$HARNISH_ROOT/scripts/loop-step.sh" .harnish/harnish-current-work.json
STATUS=ALL_DONE โ report completion โ STOP
STATUS=NO_DOING โ move first Todo to Doing (see "TodoโDoing" below)
STATUS=ACTIVE โ check next action of current task โ start loop
One Loop Cycle = READ โ ACT โ LOG โ PROGRESS
[READ]
[ACT]
- Create/modify files according to the guide
- Hard guardrail violation โ immediately STOP + escalation
- Soft guardrail violation โ warning + auto-correction
[LOG] (every 3 actions)
[PROGRESS] Run acceptance_criteria:
- Pass โ move DoingโDone โ record asset (if applicable) โ TASK_COMPLETE_COUNT += 1 โ move next TodoโDoing โ repeat loop
- 1-2 failures โ analyze cause โ fix โ go to [ACT]
- 3 failures โ record failure asset โ escalation. Do not attempt to resolve alone.
How to Run acceptance_criteria
| Form | Execution | Pass Criteria |
|---|
| bash command | Execute as-is | exit 0 |
| Condition list | Verify each condition in code | All โ |
| Mixed | bash first, then conditions | Both pass |
| None | Escalation (cannot mark Done without criteria) | โ |
Behavior When acceptance_criteria Is Empty
The empty-criteria check is an entry gate at every transition into Doing, not a post-execution check:
- Seeding (Step 2): Extract criteria from PRD ยง6. If mapping is not possible โ immediately ask the user: "Please specify acceptance_criteria for Task {id}." Do not seed the task without criteria.
- TodoโDoing transition: If
acceptance_criteria is empty or missing โ escalate before transitioning to Doing. The task does not enter Doing.
- Mid-session edits: If a task already in Doing has its criteria emptied (rare; usually a user manual edit) โ escalate immediately on next loop entry, before [ACT]. This is separate from the 3-failure rule.
TodoโDoing Transition
- Check
.todo.phases[0].tasks[0] (first incomplete task)
- Verify
depends_on is satisfied (all prerequisite Tasks exist in .done.phases)
- Update harnish-current-work.json:
.doing.task = {id, title, started_at, current, next_action, blocker:null, retry_count:0, context}, remove the task from .todo
- Update
.metadata.status
-
HARNISH_ROOT="${CLAUDE_PLUGIN_ROOT}"
bash "$HARNISH_ROOT/scripts/validate-progress.sh" .harnish/harnish-current-work.json
DoingโDone Transition
- Find the same phase in
.done.phases (add a new Phase if not found)
- Add completed task:
{id, title, result: "one-line summary", files_changed, verification, duration}
.doing.task = null, .stats.completed_tasks += 1
-
HARNISH_ROOT="${CLAUDE_PLUGIN_ROOT}"
bash "$HARNISH_ROOT/scripts/validate-progress.sh" .harnish/harnish-current-work.json
On Phase Completion (Milestone)
โ
Milestone: Phase {N} โ {title}
Completed: {M} tasks / Changed: {K} files
Next: Phase {N+1} โ Shall we continue?
Run RAG compression:
HARNISH_ROOT="${CLAUDE_PLUGIN_ROOT}"
bash "$HARNISH_ROOT/scripts/compress-progress.sh" .harnish/harnish-current-work.json --trigger milestone --phase {N}
Counter-based compression (LLM tracks TASK_COMPLETE_COUNT in conversation; every 5):
HARNISH_ROOT="${CLAUDE_PLUGIN_ROOT}"
bash "$HARNISH_ROOT/scripts/compress-progress.sh" .harnish/harnish-current-work.json --trigger count
Run the above only when TASK_COMPLETE_COUNT % 5 == 0. The decision to run is the LLM's; the bash invocation itself does not check the counter.
Wait for user response โ "continue" โ next Phase โ repeat loop. All Phases Done โ completion report.
Escalation Report
๐ Escalation: Task {ID} โ {title}
Blocked at: {file/function/command}
Attempts: 1. {attempt}: {result} / 2. ... / 3. ...
Options: A. {A} / B. {B}
Prohibited Mid-Loop
The only permitted stop points inside Step 3 are:
- Milestone HITL โ at phase boundary (see "On Phase Completion")
- Escalation โ 3 consecutive acceptance_criteria failures
- Hard guardrail violation โ see Guardrails
Any other interruption is prohibited โ including but not limited to:
- Asking the user for permission to continue without a blocker
- Proposing a mid-phase summary/checkpoint due to context size or task count
- Stopping because "many tasks completed" without a defined phase boundary
Context fatigue is not a stop condition. If context is tight, rely on compress-progress.sh and continue.
Step 4: Session Restore (Anchoring)
When harnish-current-work.json exists + new session starts:
HARNISH_ROOT="${CLAUDE_PLUGIN_ROOT}"
bash "$HARNISH_ROOT/scripts/validate-progress.sh" .harnish/harnish-current-work.json
bash "$HARNISH_ROOT/scripts/loop-step.sh" .harnish/harnish-current-work.json
If Doing exists, resume from "next action" / otherwise first Todo Task. Report then โ enter Step 3 loop:
๐ Session restored
Current: Phase {N} / Task {ID} โ {title}
Next: {next_action}
Step 5: Experience Accumulation
Asset Recording Criteria
| Condition | Type | Required/Recommended |
|---|
| Same error 2+ times AND resolved | failure | Required |
| User says "remember/record pattern" | Corresponding type | Required |
| User says "never do ~" | guardrail | Required |
| First-try success AND generalizable | pattern | Recommended |
| A vs B choice AND clear rationale | decision | Recommended |
| Same code structure 2+ times | snippet | Recommended |
| None of the above | โ | Do not record |
Recording:
HARNISH_ROOT="${CLAUDE_PLUGIN_ROOT}"
bash "$HARNISH_ROOT/scripts/record-asset.sh" \
--type {type} --tags "{task-id},{phase}" \
--title "{one line}" --content "{content}" \
--base-dir "$(pwd)/.harnish"
Manual Triggers
| Utterance | Action |
|---|
| "์์ฐ ํํฉ" / "asset status" | check-thresholds.sh |
| "์์ฐ ์์ถ" / "compress assets" | compress-assets.sh |
| "์ด ํจํด ๊ธฐ์ตํด" / "remember this pattern" | record-asset.sh --type pattern |
| "์คํฌ๋ก ๋ง๋ค์ด" / "make it a skill" | skillify.sh |
| "์์ฐ ํ์ง" / "asset quality" | quality-gate.sh |
| "์๋ฐ ํ์ธ" / "check violations" | check-violations.sh |
| "์์ฐ ๋ณด์กด ์ ์ฑ
" / "asset retention policy" | references/retention-policy.md (read-only โ purge-assets is invoked out-of-band via CLI/cron, not via skill utterance) |
Step 6: Post-Completion Ceremony
Trigger: Todo empty AND no Doing AND .metadata.ceremony_done is false/missing.
Purpose: turn "all tasks done" into a deliberate closing beat โ inspect, compress, summarize, suggest next โ rather than a sudden STOP.
6.1 Automatic Inspection (read-only)
Invoke galmuri:ralphi (sibling plugin) on files changed since session start. Report findings inline. DO NOT auto-fix โ fixing is a separate user trigger. If galmuri is not installed, skip this step and surface a one-line note ("galmuri not installed โ skipping post-Done inspection").
๐ Post-Done inspection (galmuri:ralphi, read-only)
Files changed this session: {N}
Findings: {count by severity}
6.2 Asset Compression Check
Run compress-assets.sh with --dry-run. If any tag accumulated โฅ COMPRESS_EVERY_N (5) entries, suggest compression (do not auto-apply):
HARNISH_ROOT="${CLAUDE_PLUGIN_ROOT}"
bash "$HARNISH_ROOT/scripts/compress-assets.sh" --dry-run --all --base-dir "$(pwd)/.harnish"
6.3 Summary Generation
3-line summary:
โ
Session summary
Files changed: {count} ({short list})
Key decisions: {1-2 one-liners from .harnish/harnish-assets.jsonl recorded this session}
Suggested next: {e.g., galmuri:ralphi fix | deploy | handoff | sibling plugin invocation}
6.4 HITL Before Persist
"Ceremony complete. Save session summary to docs/session-{YYYY-MM-DD}.md? (y / n / edit-slug)"
y โ save + set .metadata.ceremony_done: true โ STOP
n โ set .metadata.ceremony_done: true โ STOP without save
edit-slug โ ask for slug, then y path
Prohibited in Step 6
- Auto-fixing galmuri:ralphi findings (report only)
- Auto-applying asset compression (suggest only)
- Modifying harnish-current-work.json beyond
.metadata.ceremony_done (done object is frozen)
- Re-entering the ceremony on a session that already ran it (single-fire per session)
Context Budget
| When | Reads |
|---|
| Step 1 (Mode Detection) | Mode-specific references only (max 2): see Mode Detection table |
| Step 2 (Seeding) | PRD file (docs/prd-*.md), references/progress-template.md, query-assets output |
| Step 3 [READ] | Current task fields from harnish-current-work.json, query-assets output (filtered by task tags) |
| Step 3 [ACT] | Files referenced by current task only โ no exploration outside scope |
| Step 3 [LOG] | None (write-only) |
| Step 3 [PROGRESS] | Test outputs only |
| Step 4 (Restore) | harnish-current-work.json, no source code |
| Step 5 (Experience) | references/thresholds.md, asset query output |
| Step 6 (Post-Completion) | galmuri:ralphi output + compress-assets dry-run output + session assets |
Load at most 2 references at a time. Other references must wait for a phase switch.
Guardrails
Soft (warning + correction):
- 100+ line file change โ review task splitting
- Cannot declare Done without tests
- Cannot mark Done a task without acceptance_criteria
- Warning when modifying files outside current task scope
Hard (immediate STOP + escalation):
- DROP TABLE / DROP DATABASE prohibited
- Installing new packages not specified in PRD prohibited
- Inserting hardcoded secrets prohibited
- Unrelated refactoring of files outside scope prohibited
- Deleting harnish-current-work.json or directly modifying the done object prohibited
- Mid-loop interruption outside milestone HITL / 3-failure escalation / hard-guardrail violation prohibited
Termination Conditions