harness-everything 0.11.6 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +13 -0
- package/README.md +7 -3
- package/ci/mechanism-2a-rule-of-3.test.js +71 -0
- package/ci/mechanism-2ah-workflow-lifecycle.test.js +139 -0
- package/ci/mechanism-2c-state-persist.test.js +45 -2
- package/ci/mechanism-2t-issue-20.test.js +0 -8
- package/ci/mechanism-30-opencode-plugin-loadability.test.js +39 -7
- package/docs/architecture.md +17 -0
- package/docs/audit.md +52 -5
- package/docs/release-evidence.md +3 -0
- package/docs/workflow-runtime.md +13 -0
- package/docs/workflows/environment-detection.md +47 -37
- package/docs/workflows/eval-harness.md +45 -38
- package/docs/workflows/fable-discipline.md +45 -33
- package/docs/workflows/git-commit.md +53 -45
- package/docs/workflows/grill-me.md +36 -38
- package/docs/workflows/grill-with-docs.md +36 -46
- package/docs/workflows/harness-everything.md +59 -57
- package/docs/workflows/improve-codebase-architecture.md +36 -44
- package/docs/workflows/install-cognitive-os.md +36 -29
- package/docs/workflows/repo-docs.md +29 -40
- package/docs/workflows/rewrite-commits.md +40 -36
- package/docs/workflows/security-review.md +34 -53
- package/docs/workflows/skill-creator.md +39 -56
- package/docs/workflows/skill-style.md +35 -40
- package/docs/workflows/using-git-worktrees.md +40 -44
- package/docs/workflows/verification-loop.md +43 -48
- package/docs/workflows/verify-before-claim.md +37 -40
- package/docs/workflows/zoom-out.md +39 -51
- package/harness-everything/SKILL.md +1 -1
- package/harness-everything/scripts/kernel-router.js +38 -10
- package/hooks/scripts/lib/workflow-isolation.js +30 -1
- package/hooks/scripts/rule-of-3-tracker.js +17 -9
- package/hooks/scripts/state-persist.js +14 -6
- package/hooks/scripts/workflow-gate.js +5 -1
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/scripts/lib/workflow-isolation.js +30 -1
- package/plugins/harness-everything/hooks/scripts/rule-of-3-tracker.js +17 -9
- package/plugins/harness-everything/hooks/scripts/state-persist.js +14 -6
- package/plugins/harness-everything/hooks/scripts/workflow-gate.js +5 -1
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
- package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +38 -10
- package/docs/issue-20-rollup.md +0 -47
- package/docs/reviews/pr-142-issue-131.md +0 -89
|
@@ -1,69 +1,59 @@
|
|
|
1
|
-
# Workflow: Grill
|
|
1
|
+
# Workflow: Grill With Docs
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Tests a plan against the recorded domain language and past decisions, tightens fuzzy terminology into canonical terms, and writes CONTEXT.md and ADR updates inline as choices settle.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Source of truth: `grill-with-docs/SKILL.md`.
|
|
6
6
|
|
|
7
7
|
## 1. Skill Behavior Workflow
|
|
8
8
|
|
|
9
|
-
This section visualizes how the `grill-with-docs` skill executes internally, detailing the sequence of operations, state transitions, and evaluation steps.
|
|
10
|
-
|
|
11
9
|
```mermaid
|
|
12
10
|
graph TD
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
ResolveADRPath -->|No Folder Found| WriteFallback["Write to committable docs/adr"]
|
|
23
|
-
|
|
24
|
-
WriteDocs --> ToSpec["Hand off to to-spec for Outline Preview & Spec/ADR Publishing"]
|
|
25
|
-
WriteFallback --> ToSpec
|
|
26
|
-
ToSpec --> End([Route to to-tickets / fable-mode / tdd])
|
|
11
|
+
PlanInput["Plan needing domain alignment"] --> ResolveStorage["Resolve storage with project-docs-resolver.js; CONTEXT-MAP.md root wins"]
|
|
12
|
+
ResolveStorage --> ChallengeTerms["Challenge glossary conflicts; sharpen fuzzy terms to canonical ones"]
|
|
13
|
+
ChallengeTerms --> ScenarioTest["Stress-test relationships with concrete scenarios; cross-check claims against code"]
|
|
14
|
+
ScenarioTest --> InlineUpdate["Update context glossary inline, never batched; zero implementation details"]
|
|
15
|
+
InlineUpdate --> ADRGate{"ADR warranted: hard to reverse plus surprising without context plus real trade-off?"}
|
|
16
|
+
ADRGate -->|Yes| WriteADR["Offer and write ADR at resolved location"]
|
|
17
|
+
ADRGate -->|No| SkipADR["Skip ADR; keep pure glossary"]
|
|
18
|
+
WriteADR --> Handoff["Hand off aligned design to to-spec"]
|
|
19
|
+
SkipADR --> Handoff
|
|
27
20
|
```
|
|
28
21
|
|
|
29
|
-
---
|
|
30
|
-
|
|
31
22
|
## 2. Triggering and Routing Path
|
|
32
23
|
|
|
33
|
-
This diagram illustrates how the `grill-with-docs` skill is triggered through user requests or developer actions, and how it integrates or chains together with other companion skills in the Harness OS ecosystem to form unified workflows.
|
|
34
|
-
|
|
35
24
|
```mermaid
|
|
36
25
|
graph LR
|
|
37
|
-
|
|
38
|
-
GrillMe["grill-me
|
|
39
|
-
GWD
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
DomainStress["Input: stress-testing a plan against domain language and documented decisions"] --> GWD["grill-with-docs / SKILL.md"]
|
|
27
|
+
GWD --> GrillMe["grill-me for unverified design"]
|
|
28
|
+
GWD --> ToSpec["to-spec for aligned design"]
|
|
29
|
+
ToSpec --> ToTickets["to-tickets for execution"]
|
|
30
|
+
ToSpec --> FableMode["fable-mode for execution"]
|
|
31
|
+
ToSpec --> TDD["tdd for execution"]
|
|
42
32
|
```
|
|
43
33
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## 3. Real-World Use Case Flowchart
|
|
47
|
-
|
|
48
|
-
Here we model concrete real-world scenarios and use cases of the `grill-with-docs` skill, illustrating standard success paths, error handling, or recovery loops.
|
|
34
|
+
## 3. Real-World Use Case
|
|
49
35
|
|
|
50
36
|
```mermaid
|
|
51
37
|
graph TD
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
SyncCode --> Done([Zero architectural drift achieved])
|
|
38
|
+
RetryProposal["Proposal: change notification retry limits"] --> ResolveDocs["Resolve docs location; read CONTEXT.md and rate-limit ADR"]
|
|
39
|
+
ResolveDocs --> Conflict["Find glossary conflict: retry versus backoff"]
|
|
40
|
+
Conflict --> Scenario["Scenario test: burst retry against overload protection limit"]
|
|
41
|
+
Scenario --> GlossaryFix["Inline glossary fix to canonical terms"]
|
|
42
|
+
GlossaryFix --> ADRDecision["ADR offered because limit change is hard to reverse and involves trade-off"]
|
|
43
|
+
ADRDecision --> AlignedHandoff["Aligned design to to-spec; execution to to-tickets, fable-mode, or tdd"]
|
|
59
44
|
```
|
|
60
45
|
|
|
61
|
-
|
|
46
|
+
Concrete example: a retry-limit change is checked against the existing rate-limiting ADR and code. Fuzzy retry language is sharpened, the glossary is fixed inline, and only because the decision is hard to reverse and surprising without context is an ADR written. An unverified design would go to `grill-me` first instead.
|
|
62
47
|
|
|
63
|
-
|
|
48
|
+
Deep detail: `grill-with-docs/references/session-playbook.md`. Formats: `grill-with-docs/ADR-FORMAT.md`, `grill-with-docs/CONTEXT-FORMAT.md`.
|
|
64
49
|
|
|
65
|
-
|
|
50
|
+
## 4. Verification Check
|
|
66
51
|
|
|
67
|
-
- [ ]
|
|
68
|
-
- [ ]
|
|
69
|
-
- [ ]
|
|
52
|
+
- [ ] Storage resolved with `multi-agent-workspace/scripts/project-docs-resolver.js`; `<workspace>/CONTEXT-MAP.md` root wins
|
|
53
|
+
- [ ] Fuzzy terms sharpened to canonical ones; glossary stays pure with zero implementation details
|
|
54
|
+
- [ ] Relationships tested with concrete scenarios and claims cross-checked against code
|
|
55
|
+
- [ ] Context glossary updated inline, never batched
|
|
56
|
+
- [ ] ADR offered only when hard to reverse plus surprising without context plus a real trade-off
|
|
57
|
+
- [ ] ADRs meet the 3-part bar; handoff to `to-spec` after alignment
|
|
58
|
+
- [ ] Routing respected: unverified design to `grill-me`; aligned design to `to-spec`; execution to `to-tickets`, `fable-mode`, or `tdd`
|
|
59
|
+
- [ ] Not used for verifying unstable designs without a grilling pass, and not used for spec publishing without grilling
|
|
@@ -1,95 +1,97 @@
|
|
|
1
1
|
# Workflow: Harness Everything
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Route software/project work through the Harness kernel: classify Tier 1/2/3, establish mandatory invariants, then let the agent choose tactics and domain skills. Not general Q&A or non-software writing.
|
|
4
|
+
|
|
5
|
+
Source of truth: `harness-everything/SKILL.md`. Deep dive: `harness-everything/references/triage-and-tiers.md`.
|
|
4
6
|
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
## 1. Skill Behavior Workflow
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
The kernel establishes the smallest applicable workflow before mutation. Suggested skills are mandatory to evaluate and advisory to execute; the selected topology is mandatory to resolve.
|
|
10
12
|
|
|
11
13
|
```mermaid
|
|
12
14
|
graph TD
|
|
13
15
|
Start([User Prompt Received]) --> CheckSoftware{Software / Engineering Task?}
|
|
14
|
-
CheckSoftware -->|No: Pure Chat / Translation / Web Search| BypassHarness["Bypass Harness
|
|
15
|
-
CheckSoftware -->|Yes: Code / Architecture / Project| ExecuteRouter["
|
|
16
|
-
ExecuteRouter -->
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
FactReminder --> FinalizeOutput
|
|
33
|
-
FinalizeOutput --> Normalization["Apply Always-On ADHD-Friendly Output Shaping (Global Normalization)"]
|
|
34
|
-
Normalization --> End([Developer receives highly focused, concise response])
|
|
35
|
-
BypassHarness --> End
|
|
16
|
+
CheckSoftware -->|No: Pure Chat / Translation / Web Search| BypassHarness["Bypass Harness Completely - Reply Directly"]
|
|
17
|
+
CheckSoftware -->|Yes: Code / Architecture / Project| ExecuteRouter["Run kernel-router.js OR reuse UserPromptSubmit hook output"]
|
|
18
|
+
ExecuteRouter --> TriageTier{Triage Tier}
|
|
19
|
+
TriageTier -->|Tier 1: Trivial| Tier1Route["direct-single: smallest sufficient tactic"]
|
|
20
|
+
TriageTier -->|Tier 2: Standard| Tier2Route["iterative-single: verify each increment"]
|
|
21
|
+
TriageTier -->|Tier 3: Macro| Tier3Route["fable-staged / fable-parallel / fable-multi-agent-workspace"]
|
|
22
|
+
Tier1Route --> Checkpoint["Surface Harness Routing Checkpoint"]
|
|
23
|
+
Tier2Route --> Checkpoint
|
|
24
|
+
Tier3Route --> Checkpoint
|
|
25
|
+
Checkpoint --> Evaluate["Read each suggested SKILL.md: USE FOR, DO NOT USE FOR, flow, hard rules"]
|
|
26
|
+
Evaluate --> Execute["Execute selected topology to resolution"]
|
|
27
|
+
Execute --> VerifyGate{Objective evidence supports completion?}
|
|
28
|
+
VerifyGate -->|Yes| Done([Evidence-backed completion])
|
|
29
|
+
VerifyGate -->|No| Diagnose["Diagnose / bounded re-plan"]
|
|
30
|
+
Diagnose --> RetryCheck{Same-signature failure x3?}
|
|
31
|
+
RetryCheck -->|No| Execute
|
|
32
|
+
RetryCheck -->|Yes| ZoomOut["zoom-out: stop edits, rebuild facts read-only, report RESUME or ESCALATE"]
|
|
33
|
+
ZoomOut --> Execute
|
|
36
34
|
```
|
|
37
35
|
|
|
38
36
|
---
|
|
39
37
|
|
|
40
38
|
## 2. Triggering and Routing Path
|
|
41
39
|
|
|
42
|
-
This diagram
|
|
40
|
+
This diagram shows how the `harness-everything` skill is triggered and how it chains with companion skills. Routing suggestions are conditional on applicability; the selected topology is not advisory.
|
|
43
41
|
|
|
44
42
|
```mermaid
|
|
45
43
|
graph LR
|
|
46
|
-
UserPrompt([User Input]) --> Router["harness-everything / tier-router.js"]
|
|
47
|
-
|
|
48
|
-
Router -->|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
Ch4 --> ADHD
|
|
59
|
-
|
|
44
|
+
UserPrompt([User Input]) --> Router["harness-everything / kernel-router.js + tier-router.js"]
|
|
45
|
+
|
|
46
|
+
Router -->|Bug / Feature / Refactor| Ch1["tdd + todo-driven-workflow + verification-loop + verify-before-claim"]
|
|
47
|
+
Router -->|Commit / History / Isolation| Ch2["git-commit + rewrite-commits + using-git-worktrees + verification-loop"]
|
|
48
|
+
Router -->|Large / Multi-source / Multi-session| Ch3["fable-mode + fable-discipline + multi-agent-workspace + using-git-worktrees"]
|
|
49
|
+
Router -->|Architecture / Plan review| Ch4["improve-codebase-architecture + grill-me + grill-with-docs + to-spec + to-tickets"]
|
|
50
|
+
|
|
51
|
+
Ch1 --> Invariants["Invariants: route-before-execution, verify-before-claim, re-plan-after-x3, evaluate-before-skip, resolve-selected-workflow"]
|
|
52
|
+
Ch2 --> Invariants
|
|
53
|
+
Ch3 --> Invariants
|
|
54
|
+
Ch4 --> Invariants
|
|
55
|
+
|
|
60
56
|
style Router fill:#d35400,stroke:#e67e22,stroke-width:2px,color:#ffffff
|
|
61
|
-
style
|
|
57
|
+
style Invariants fill:#1abc9c,stroke:#16a085,stroke-width:2px,color:#ffffff
|
|
62
58
|
```
|
|
63
59
|
|
|
64
60
|
---
|
|
65
61
|
|
|
66
62
|
## 3. Real-World Use Case Flowchart
|
|
67
63
|
|
|
68
|
-
Here we model concrete real-world scenarios and use cases of the `harness-everything` skill, illustrating standard success paths, error handling, or recovery loops.
|
|
69
|
-
|
|
70
64
|
```mermaid
|
|
71
65
|
graph TD
|
|
72
|
-
Input1["User: 'Add a new settings page'"] --> Router1["
|
|
73
|
-
Router1 -->
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
Input2["User: 'Refactor DB architecture and grill my plan'"] --> Router2["tier-router.js executes"]
|
|
66
|
+
Input1["User: 'Add a new settings page'"] --> Router1["kernel-router.js executes"]
|
|
67
|
+
Router1 --> Triage2["Triaged as Tier 2: Standard Task"]
|
|
68
|
+
Triage2 --> Checkpoint1["Routing Checkpoint: tdd, todo-driven-workflow, verification-loop suggested"]
|
|
69
|
+
Checkpoint1 --> Eval1["Read each suggested SKILL.md; keep applicable, mark not-applicable with flow-grounded reason"]
|
|
70
|
+
Eval1 --> Exec1["Execute iterative-single to resolution; verify with tests before claiming done"]
|
|
71
|
+
Exec1 --> Done1([Feature delivered with objective evidence])
|
|
72
|
+
|
|
73
|
+
Input2["User: 'Refactor DB architecture across services'"] --> Router2["kernel-router.js executes"]
|
|
81
74
|
Router2 --> Triage3["Triaged as Tier 3: Macro Task"]
|
|
82
|
-
Triage3 -->
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
Triage3 --> Iso["Verify linked Git worktree isolation before source mutation"]
|
|
76
|
+
Iso --> Exec2["fable-mode stage map + per-stage checks + cold verification"]
|
|
77
|
+
Exec2 --> Done2([Staged delivery with per-stage evidence])
|
|
78
|
+
|
|
79
|
+
Input3["User: 'Just fix this typo'"] --> Router3["kernel-router.js executes"]
|
|
80
|
+
Router3 --> Triage1["Triaged as Tier 1: Trivial Task"]
|
|
81
|
+
Triage1 --> Exec3["direct-single: smallest sufficient edit, then verify"]
|
|
82
|
+
Exec3 --> Done3([Typo fixed, no ceremony added])
|
|
85
83
|
```
|
|
86
84
|
|
|
85
|
+
Escape applies only to genuinely uncovered workflow scope with explicit scope + evidence; covered obligations, isolation, and independent verification survive escape. Model confidence alone never justifies skipping the selected topology.
|
|
86
|
+
|
|
87
87
|
---
|
|
88
88
|
|
|
89
89
|
## 4. Verification Check
|
|
90
90
|
|
|
91
91
|
To ensure that the `harness-everything` skill is operating in strict compliance with Harness OS design laws, verify the following:
|
|
92
92
|
|
|
93
|
-
- [ ] **
|
|
94
|
-
- [ ] **
|
|
95
|
-
- [ ] **
|
|
93
|
+
- [ ] **Route before execution**: scope/tier and smallest applicable workflow established before mutation.
|
|
94
|
+
- [ ] **Evaluate before omission**: each suggested skill's complete `SKILL.md` flow evaluated before deciding applicability.
|
|
95
|
+
- [ ] **Resolve selected workflow**: the selected topology executed to resolution; escape only for uncovered scope with evidence.
|
|
96
|
+
- [ ] **Verify before claim**: objective evidence (tests, checks, quoted tool output) supports completion.
|
|
97
|
+
- [ ] **Re-plan on repetition**: after 3 same-signature failures, `zoom-out` reflection completed before resuming.
|
|
@@ -1,68 +1,60 @@
|
|
|
1
1
|
# Workflow: Improve Codebase Architecture
|
|
2
2
|
|
|
3
|
-
> Finds
|
|
3
|
+
> Finds thin or overweight modules and reshapes them into focused, single-responsibility units by dividing large objects and functions, isolating seams, and separating interfaces.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Source of truth: `improve-codebase-architecture/SKILL.md`.
|
|
6
6
|
|
|
7
7
|
## 1. Skill Behavior Workflow
|
|
8
8
|
|
|
9
|
-
This section visualizes how the `improve-codebase-architecture` skill executes internally, detailing the sequence of operations, state transitions, and evaluation steps.
|
|
10
|
-
|
|
11
9
|
```mermaid
|
|
12
10
|
graph TD
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
ExecuteTDD --> CheckErrors{"Cascading Errors > 3?"}
|
|
26
|
-
CheckErrors -->|Yes| Rollback["Rollback Changes & Trigger zoom-out"]
|
|
27
|
-
CheckErrors -->|No| Complete["Refactoring Complete & Record Lessons in self-evolve"]
|
|
11
|
+
RefactorAsk["Input: refactor architecture, split object, apply SRP, tech debt"] --> DiscoverScan["Scan CONTEXT.md, docs/adr/, and core interfaces first; no blind refactoring"]
|
|
12
|
+
DiscoverScan --> FindTargets["Target SRP violations over 300 lines or over 10 complexity, shallow modules, coupled seams"]
|
|
13
|
+
FindTargets --> Proposal["Present Deepening and SRP proposal: object splitting plus seam abstraction"]
|
|
14
|
+
Proposal --> Approved{"Proposal approved?"}
|
|
15
|
+
Approved -->|No| Proposal
|
|
16
|
+
Approved -->|Yes| SafetyNet{"Legacy code has tests?"}
|
|
17
|
+
SafetyNet -->|No| CharTests["Write Characterization Tests first via tdd"]
|
|
18
|
+
SafetyNet -->|Yes| Extract["Extract incrementally via tdd; verify tests after each change"]
|
|
19
|
+
CharTests --> Extract
|
|
20
|
+
Extract --> ErrorCheck{"More than 3 cascading errors?"}
|
|
21
|
+
ErrorCheck -->|Yes| Rollback["Rollback plus zoom-out; record traps in self-evolve"]
|
|
22
|
+
ErrorCheck -->|No| DoneState["Refactoring complete"]
|
|
28
23
|
```
|
|
29
24
|
|
|
30
|
-
---
|
|
31
|
-
|
|
32
25
|
## 2. Triggering and Routing Path
|
|
33
26
|
|
|
34
|
-
This diagram illustrates how the `improve-codebase-architecture` skill is triggered through user requests or developer actions, and how it integrates or chains together with other companion skills in the Harness OS ecosystem to form unified workflows.
|
|
35
|
-
|
|
36
27
|
```mermaid
|
|
37
28
|
graph LR
|
|
38
|
-
|
|
39
|
-
ICA
|
|
40
|
-
ICA
|
|
41
|
-
ICA
|
|
29
|
+
TechDebt["Trigger: refactor architecture or split object or apply SRP or tech debt"] --> ICA["improve-codebase-architecture / SKILL.md"]
|
|
30
|
+
ICA --> TDD["tdd: Characterization Tests first, then incremental extraction"]
|
|
31
|
+
ICA --> ZoomOut["zoom-out: invoked with rollback after more than 3 cascading errors"]
|
|
32
|
+
ICA --> SelfEvolve["self-evolve: record traps"]
|
|
42
33
|
```
|
|
43
34
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## 3. Real-World Use Case Flowchart
|
|
47
|
-
|
|
48
|
-
Here we model concrete real-world scenarios and use cases of the `improve-codebase-architecture` skill, illustrating standard success paths, error handling, or recovery loops.
|
|
35
|
+
## 3. Real-World Use Case
|
|
49
36
|
|
|
50
37
|
```mermaid
|
|
51
38
|
graph TD
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
BloatedUtil["utils.js handles email, tokens, DB pooling, logging"] --> ScanInterfaces["Scan CONTEXT.md, ADRs, core interfaces"]
|
|
40
|
+
ScanInterfaces --> SRPProposal["Propose split into focused units plus seam abstractions"]
|
|
41
|
+
SRPProposal --> CharNet["Add Characterization Tests for untested legacy paths"]
|
|
42
|
+
CharNet --> Incremental["Incremental extraction with test check after each step"]
|
|
43
|
+
Incremental --> RollbackGate{"More than 3 cascading errors?"}
|
|
44
|
+
RollbackGate -->|Yes| RollbackZoom["Rollback and zoom-out"]
|
|
45
|
+
RollbackGate -->|No| ModularDone["SRP-compliant modules with safety net"]
|
|
58
46
|
```
|
|
59
47
|
|
|
60
|
-
|
|
48
|
+
Concrete example: a 600-line utility module is scanned for interfaces and ADR constraints, proposed for splitting into single-purpose units, guarded by Characterization Tests, then extracted step by step with verification after each change.
|
|
61
49
|
|
|
62
|
-
|
|
50
|
+
Deep detail: `improve-codebase-architecture/references/README.md`.
|
|
63
51
|
|
|
64
|
-
|
|
52
|
+
## 4. Verification Check
|
|
65
53
|
|
|
66
|
-
- [ ]
|
|
67
|
-
- [ ]
|
|
68
|
-
- [ ]
|
|
54
|
+
- [ ] `CONTEXT.md`, `docs/adr/`, and core interfaces scanned first; no blind refactoring
|
|
55
|
+
- [ ] Targets match the skill bar: SRP violations over 300 lines or over 10 complexity, shallow modules, coupled seams
|
|
56
|
+
- [ ] Deepening and SRP proposal with object splitting and seam abstraction presented and approved before code changes
|
|
57
|
+
- [ ] `tdd` launched; Characterization Tests added first when legacy code lacks tests
|
|
58
|
+
- [ ] Extraction done incrementally with tests verified after each change
|
|
59
|
+
- [ ] On more than 3 cascading errors, changes rolled back with `zoom-out` and traps recorded in `self-evolve`
|
|
60
|
+
- [ ] Not used for features, bugfixes, or style-only cleanups with no structure change
|
|
@@ -1,60 +1,67 @@
|
|
|
1
1
|
# Workflow: Install Cognitive OS
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Explain or explicitly apply the Harness cognitive policy: Discover, Think, Try, Summarize, Record. This skill is a human-readable/manual entry point, not an installer and not a required peer-skill selection.
|
|
4
|
+
|
|
5
|
+
Source of truth: `install-cognitive-os/SKILL.md`. Deep dive: `install-cognitive-os/references/cognitive-loop.md`.
|
|
6
|
+
|
|
7
|
+
The runtime invariant contract is established by supported host integrations independently of this skill. Domain skills never need to invoke this skill first as long as Harness invariants remain satisfied.
|
|
4
8
|
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
## 1. Skill Behavior Workflow
|
|
8
12
|
|
|
9
|
-
This section visualizes how the `install-cognitive-os` skill executes internally, detailing the sequence of operations, state transitions, and evaluation steps.
|
|
10
|
-
|
|
11
13
|
```mermaid
|
|
12
14
|
graph TD
|
|
13
|
-
Start([
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
Start([Explicit request OR host without kernel context]) --> Discover["Discover: verify relevant workspace state with read-only tools"]
|
|
16
|
+
Discover --> Think["Think: establish intent, scope, and failure modes"]
|
|
17
|
+
Think --> Try["Try: make the smallest useful change and gather evidence"]
|
|
18
|
+
Try --> Summarize["Summarize: ground conclusions in tool output"]
|
|
19
|
+
Summarize --> FailCheck{Same-signature failure x3?}
|
|
20
|
+
FailCheck -->|Yes| ZoomOut["zoom-out: stop edits, rebuild facts, report RESUME or ESCALATE"]
|
|
21
|
+
FailCheck -->|No| Record["Record: persist milestones only when evidence supports them"]
|
|
22
|
+
ZoomOut --> Think
|
|
23
|
+
Record --> End([Evidence-grounded work, no fixed domain sequence])
|
|
19
24
|
```
|
|
20
25
|
|
|
26
|
+
This skill writes no installer state, deploys no hooks, and copies no skill directories. Workspace installation is owned by the general installer (`node scripts/installer.js`), not by this skill.
|
|
27
|
+
|
|
21
28
|
---
|
|
22
29
|
|
|
23
30
|
## 2. Triggering and Routing Path
|
|
24
31
|
|
|
25
|
-
This diagram illustrates how the `install-cognitive-os` skill is triggered through user requests or developer actions, and how it integrates or chains together with other companion skills in the Harness OS ecosystem to form unified workflows.
|
|
26
|
-
|
|
27
32
|
```mermaid
|
|
28
33
|
graph LR
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
Trigger["Explain policy / Apply loop manually / Debug cognitive behavior"] --> Skill["install-cognitive-os / SKILL.md"]
|
|
35
|
+
Skill -->|No kernel context| Manual["Run Discover → Think → Try → Summarize → Record explicitly"]
|
|
36
|
+
Skill -->|Kernel present| Policy["Treat as policy reference; domain skill proceeds directly"]
|
|
37
|
+
Manual --> Gates["Gates: evidence before claims; re-plan after x3 same-signature failures"]
|
|
38
|
+
Policy --> Gates
|
|
39
|
+
|
|
40
|
+
style Skill fill:#d35400,stroke:#e67e22,stroke-width:2px,color:#ffffff
|
|
41
|
+
style Gates fill:#1abc9c,stroke:#16a085,stroke-width:2px,color:#ffffff
|
|
34
42
|
```
|
|
35
43
|
|
|
36
44
|
---
|
|
37
45
|
|
|
38
46
|
## 3. Real-World Use Case Flowchart
|
|
39
47
|
|
|
40
|
-
Here we model concrete real-world scenarios and use cases of the `install-cognitive-os` skill, illustrating standard success paths, error handling, or recovery loops.
|
|
41
|
-
|
|
42
48
|
```mermaid
|
|
43
49
|
graph TD
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Scan --> BuildAdvisory["Appends mandatory routing checkpoint and cognitive compliance blocks to .cursorrules"]
|
|
47
|
-
BuildAdvisory --> CopySkills["Copies all current skills into .cursor/skills/ and .github/skills/"]
|
|
48
|
-
CopySkills --> CheckHeal["Runs preflight audit to confirm 100% path coverage"]
|
|
49
|
-
CheckHeal --> Done([Harness OS environment setup is complete and active])
|
|
50
|
-
```
|
|
50
|
+
Case1["User on advisory-only host: 'walk me through the loop'"] --> Explain["Explain Discover → Think → Try → Summarize → Record with a small example"]
|
|
51
|
+
Explain --> Done1([User can apply the loop manually])
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
Case2["Host without automatic kernel context"] --> Apply["Apply the five steps explicitly to the task at hand"]
|
|
54
|
+
Apply --> Done2([Work proceeds with evidence gates, no hook installation claimed])
|
|
55
|
+
|
|
56
|
+
Case3["User asks for domain work: 'implement feature X test-first'"] --> Direct["Proceed directly with tdd; this skill is NOT a prerequisite"]
|
|
57
|
+
Direct --> Done3([Domain skill executes under Harness invariants])
|
|
58
|
+
```
|
|
53
59
|
|
|
54
60
|
## 4. Verification Check
|
|
55
61
|
|
|
56
62
|
To ensure that the `install-cognitive-os` skill is operating in strict compliance with Harness OS design laws, verify the following:
|
|
57
63
|
|
|
58
|
-
- [ ] **
|
|
59
|
-
- [ ] **
|
|
60
|
-
- [ ] **
|
|
64
|
+
- [ ] **Policy, not installation**: no hook deployment, file copying, or config mutation claimed as this skill's effect.
|
|
65
|
+
- [ ] **Full five-step loop**: Discover → Think → Try → Summarize → Record applied in order, not the truncated four-step variant.
|
|
66
|
+
- [ ] **Evidence gates honored**: completion claims need evidence; repeated same-signature failures require re-planning via `zoom-out`.
|
|
67
|
+
- [ ] **No prerequisite fabrication**: domain skills (`tdd`, `security-review`, `repo-docs`) proceed without selecting this skill first.
|
|
@@ -1,64 +1,53 @@
|
|
|
1
1
|
# Workflow: Repo Docs
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Creates or refreshes reader-focused README.md and AGENTS.md from real repository scans, carefully blending discovered facts with existing custom notes for projects missing docs or needing better agent onboarding.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Source of truth: `repo-docs/SKILL.md`.
|
|
6
6
|
|
|
7
7
|
## 1. Skill Behavior Workflow
|
|
8
8
|
|
|
9
|
-
This section visualizes how the `repo-docs` skill executes internally, detailing the sequence of operations, state transitions, and evaluation steps.
|
|
10
|
-
|
|
11
9
|
```mermaid
|
|
12
10
|
graph TD
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ReadOld --> ClassifyProductArchetype
|
|
20
|
-
ClassifyProductArchetype --> LoadTemplates["Load standard README and AGENTS templates"]
|
|
21
|
-
LoadTemplates --> SmartMerge["Smartly Merge Codebase Facts + Bespoke Notes + Template Structure"]
|
|
22
|
-
SmartMerge --> FormatMarkdown["Format documents following clean layout rules"]
|
|
23
|
-
FormatMarkdown --> WriteFiles["Save / Merge README.md and AGENTS.md at Root or .github/"]
|
|
24
|
-
WriteFiles --> End([Professional onboarding documentation created without losing history])
|
|
11
|
+
MissingDocs["Input: missing docs or request to update README.md and AGENTS.md"] --> ScanConfigs["Scan configs such as package.json and Cargo.toml as Source of Truth; never fabricate"]
|
|
12
|
+
ScanConfigs --> ReadExisting["Read existing docs fully first; extract bespoke notes: env vars, URLs, gotchas"]
|
|
13
|
+
ReadExisting --> PickTemplate["Pick template from repo-docs/templates/ else built-in structure"]
|
|
14
|
+
PickTemplate --> DraftDocs["Draft README as user journey; AGENTS.md as conventions and build/test commands"]
|
|
15
|
+
DraftDocs --> VerifyCmds["Verify commands run; mark doubts with TODO Pending confirmation; ask via grill-me"]
|
|
16
|
+
VerifyCmds --> WriteRoot["Write to root; if protected use .github/AGENTS.md or docs/README.md"]
|
|
25
17
|
```
|
|
26
18
|
|
|
27
|
-
---
|
|
28
|
-
|
|
29
19
|
## 2. Triggering and Routing Path
|
|
30
20
|
|
|
31
|
-
This diagram illustrates how the `repo-docs` skill is triggered through user requests or developer actions, and how it integrates or chains together with other companion skills in the Harness OS ecosystem to form unified workflows.
|
|
32
|
-
|
|
33
21
|
```mermaid
|
|
34
22
|
graph LR
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
RepoDocs
|
|
23
|
+
UndocProject["Trigger: undocumented project needs README"] --> RepoDocs["repo-docs / SKILL.md"]
|
|
24
|
+
StructuralChange["Trigger: structural change needs AGENTS.md refresh"] --> RepoDocs
|
|
25
|
+
RepoDocs --> GrillMe["grill-me: clarify doubts marked TODO Pending confirmation"]
|
|
26
|
+
RepoDocs --> WriteOut["Write README.md and AGENTS.md to root or fallback locations"]
|
|
38
27
|
```
|
|
39
28
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## 3. Real-World Use Case Flowchart
|
|
43
|
-
|
|
44
|
-
Here we model concrete real-world scenarios and use cases of the `repo-docs` skill, illustrating standard success paths, error handling, or recovery loops.
|
|
29
|
+
## 3. Real-World Use Case
|
|
45
30
|
|
|
46
31
|
```mermaid
|
|
47
32
|
graph TD
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
33
|
+
BareRepo["New TypeScript utility package with no onboarding docs"] --> ScanProj["Scan package.json and directory tree"]
|
|
34
|
+
ScanProj --> PreserveNotes["Read existing stub docs; preserve custom env vars and gotchas"]
|
|
35
|
+
PreserveNotes --> SelectTemplate["Select library README template from repo-docs/templates/"]
|
|
36
|
+
SelectTemplate --> MergeDraft["Merge scan facts plus bespoke notes into README journey and AGENTS conventions"]
|
|
37
|
+
MergeDraft --> VerifyStep["Verify build and test commands; mark unconfirmed items TODO Pending confirmation"]
|
|
38
|
+
VerifyStep --> PublishDocs["Write README.md and AGENTS.md to root or fallback"]
|
|
54
39
|
```
|
|
55
40
|
|
|
56
|
-
|
|
41
|
+
Concrete example: an undocumented utility repo is scanned for its real entry points and scripts, its bespoke environment notes are preserved, a template from `repo-docs/templates/` shapes the draft, commands are verified, and the merged README and AGENTS files are written without blind overwrites.
|
|
57
42
|
|
|
58
|
-
|
|
43
|
+
Deep detail: `repo-docs/references/process-guide.md`.
|
|
59
44
|
|
|
60
|
-
|
|
45
|
+
## 4. Verification Check
|
|
61
46
|
|
|
62
|
-
- [ ]
|
|
63
|
-
- [ ]
|
|
64
|
-
- [ ]
|
|
47
|
+
- [ ] Configs scanned as Source of Truth; no facts fabricated without repo evidence
|
|
48
|
+
- [ ] Existing docs read fully first; bespoke notes preserved and never overwritten blindly
|
|
49
|
+
- [ ] Template picked from `repo-docs/templates/` or built-in structure applied
|
|
50
|
+
- [ ] `README.md` covers the user journey; `AGENTS.md` covers conventions and build/test commands
|
|
51
|
+
- [ ] Commands verified to run; unresolved doubts marked `// TODO: Pending confirmation` and clarified with `grill-me`
|
|
52
|
+
- [ ] Written to root, or to `<workspace>/.github/AGENTS.md` and `<workspace>/docs/README.md` when root is protected
|
|
53
|
+
- [ ] Not used for marketing copy, fabrication without scanning, or non-repository wikis
|