harness-everything 0.11.6 → 0.12.0

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.
Files changed (105) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +45 -0
  4. package/README.md +7 -3
  5. package/behavioral-evals/README.md +37 -0
  6. package/behavioral-evals/cases/self-evolve-retrieval-recurrence.yaml +48 -0
  7. package/behavioral-evals/paired-benchmark.js +211 -5
  8. package/ci/contract-integrity.test.js +68 -2
  9. package/ci/mechanism-2a-rule-of-3.test.js +71 -0
  10. package/ci/mechanism-2ah-workflow-lifecycle.test.js +276 -0
  11. package/ci/mechanism-2c-state-persist.test.js +45 -2
  12. package/ci/mechanism-2t-issue-20.test.js +0 -8
  13. package/ci/mechanism-30-opencode-plugin-loadability.test.js +39 -7
  14. package/ci/mechanism-32-paired-benchmark.test.js +139 -0
  15. package/ci/openai-plugin-package.test.js +17 -0
  16. package/ci/self-evolve-loop.test.js +37 -2
  17. package/ci/telemetry.test.js +31 -1
  18. package/docs/architecture.md +17 -0
  19. package/docs/audit.md +52 -5
  20. package/docs/release-evidence.md +3 -0
  21. package/docs/workflow-runtime.md +13 -0
  22. package/docs/workflows/environment-detection.md +47 -37
  23. package/docs/workflows/eval-harness.md +45 -38
  24. package/docs/workflows/fable-discipline.md +45 -33
  25. package/docs/workflows/git-commit.md +53 -45
  26. package/docs/workflows/grill-me.md +36 -38
  27. package/docs/workflows/grill-with-docs.md +36 -46
  28. package/docs/workflows/harness-everything.md +59 -57
  29. package/docs/workflows/improve-codebase-architecture.md +36 -44
  30. package/docs/workflows/install-cognitive-os.md +36 -29
  31. package/docs/workflows/repo-docs.md +29 -40
  32. package/docs/workflows/rewrite-commits.md +40 -36
  33. package/docs/workflows/security-review.md +34 -53
  34. package/docs/workflows/skill-creator.md +39 -56
  35. package/docs/workflows/skill-style.md +35 -40
  36. package/docs/workflows/using-git-worktrees.md +40 -44
  37. package/docs/workflows/verification-loop.md +43 -48
  38. package/docs/workflows/verify-before-claim.md +37 -40
  39. package/docs/workflows/zoom-out.md +39 -51
  40. package/grill-with-docs/ADR-FORMAT.md +22 -0
  41. package/grill-with-docs/SKILL.md +1 -1
  42. package/harness-everything/SKILL.md +1 -1
  43. package/harness-everything/scripts/kernel-router.js +38 -10
  44. package/hooks/scripts/lib/learning-opportunity.js +22 -0
  45. package/hooks/scripts/lib/telemetry.js +40 -0
  46. package/hooks/scripts/lib/workflow-isolation.js +30 -1
  47. package/hooks/scripts/lib/workflow-runtime.js +18 -1
  48. package/hooks/scripts/rule-of-3-tracker.js +17 -9
  49. package/hooks/scripts/state-persist.js +19 -7
  50. package/hooks/scripts/workflow-disposition.js +19 -8
  51. package/hooks/scripts/workflow-gate.js +21 -4
  52. package/multi-agent-workspace/SKILL.md +1 -1
  53. package/multi-agent-workspace/scripts/index_memory.js +28 -0
  54. package/opencode-plugin/plugin.json +1 -1
  55. package/package.json +1 -1
  56. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  57. package/plugins/harness-everything/contract-integrity/scripts/audit.js +536 -0
  58. package/plugins/harness-everything/hooks/scripts/lib/learning-opportunity.js +22 -0
  59. package/plugins/harness-everything/hooks/scripts/lib/telemetry.js +40 -0
  60. package/plugins/harness-everything/hooks/scripts/lib/workflow-isolation.js +30 -1
  61. package/plugins/harness-everything/hooks/scripts/lib/workflow-runtime.js +18 -1
  62. package/plugins/harness-everything/hooks/scripts/rule-of-3-tracker.js +17 -9
  63. package/plugins/harness-everything/hooks/scripts/state-persist.js +19 -7
  64. package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +19 -8
  65. package/plugins/harness-everything/hooks/scripts/workflow-gate.js +21 -4
  66. package/plugins/harness-everything/plugin.json +1 -1
  67. package/plugins/harness-everything/skills/grill-with-docs/ADR-FORMAT.md +22 -0
  68. package/plugins/harness-everything/skills/grill-with-docs/SKILL.md +1 -1
  69. package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
  70. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +38 -10
  71. package/plugins/harness-everything/skills/multi-agent-workspace/SKILL.md +1 -1
  72. package/plugins/harness-everything/skills/multi-agent-workspace/scripts/index_memory.js +28 -0
  73. package/plugins/harness-everything/skills/self-evolve/SKILL.md +1 -1
  74. package/plugins/harness-everything/skills/self-evolve/scripts/lesson-candidate.js +52 -0
  75. package/plugins/harness-everything/skills/to-spec/SKILL.md +1 -1
  76. package/plugins/harness-everything/skills/to-spec/references/process.md +26 -0
  77. package/plugins/harness-everything/skills/to-spec/templates/cli-reference.md +14 -0
  78. package/plugins/harness-everything/skills/to-spec/templates/dev-doc.md +14 -0
  79. package/plugins/harness-everything/skills/to-spec/templates/feature-spec.md +14 -0
  80. package/plugins/harness-everything/skills/to-spec/templates/schema-doc.md +14 -0
  81. package/plugins/harness-everything/skills/to-tickets/SKILL.md +1 -1
  82. package/plugins/harness-everything/skills/to-tickets/references/publishing-and-templates.md +20 -1
  83. package/plugins/harness-everything/skills/verification-loop/SKILL.md +3 -2
  84. package/plugins/harness-everything/skills/verification-loop/references/verification-phases.md +25 -1
  85. package/plugins/harness-everything/skills/verification-loop/scripts/contract-integrity-audit.js +31 -0
  86. package/plugins/harness-everything/skills/verification-loop/templates/verification-report.template.md +3 -0
  87. package/scripts/sync-openai-plugin.js +12 -0
  88. package/self-evolve/SKILL.md +1 -1
  89. package/self-evolve/scripts/lesson-candidate.js +52 -0
  90. package/telemetry/schemas/event.schema.json +141 -22
  91. package/telemetry/scripts/report.js +42 -0
  92. package/to-spec/SKILL.md +1 -1
  93. package/to-spec/references/process.md +26 -0
  94. package/to-spec/templates/cli-reference.md +14 -0
  95. package/to-spec/templates/dev-doc.md +14 -0
  96. package/to-spec/templates/feature-spec.md +14 -0
  97. package/to-spec/templates/schema-doc.md +14 -0
  98. package/to-tickets/SKILL.md +1 -1
  99. package/to-tickets/references/publishing-and-templates.md +20 -1
  100. package/verification-loop/SKILL.md +3 -2
  101. package/verification-loop/references/verification-phases.md +25 -1
  102. package/verification-loop/scripts/contract-integrity-audit.js +31 -0
  103. package/verification-loop/templates/verification-report.template.md +3 -0
  104. package/docs/issue-20-rollup.md +0 -47
  105. package/docs/reviews/pr-142-issue-131.md +0 -89
@@ -1,95 +1,97 @@
1
1
  # Workflow: Harness Everything
2
2
 
3
- > The single entry point and dynamic router of Harness OS, triaging tasks into appropriate tiers and auto-loading synergistic knowledge guides.
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
- This section visualizes how the `harness-everything` skill executes internally, detailing the sequence of operations, state transitions, and evaluation steps.
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 OS Completely - Reply Directly"]
15
- CheckSoftware -->|Yes: Code / Architecture / Project| ExecuteRouter["Execute tier-router.js OR check UserPromptSubmit hook output"]
16
- ExecuteRouter --> DetectNewFeature{Contains new logic/files?}
17
- DetectNewFeature -->|Yes, enforce Tier 2+| PreventDegrade["Prevent Silent Degrade to Tier 1"]
18
- PreventDegrade --> TriageTier
19
- DetectNewFeature -->|No| TriageTier{Triage Tier}
20
-
21
- TriageTier -->|Tier 1: Trivial| Tier1Route["Tier 1: Direct Edit No Checklist"]
22
- TriageTier -->|Tier 2: Standard| Tier2Route["Tier 2: TDD & Todo-driven work"]
23
- TriageTier -->|Tier 3: Macro| Tier3Route["Tier 3: Fable Planning & Agent Scaffolding"]
24
-
25
- Tier1Route --> LoadGuides["Auto-load & output Synergistic Guides"]
26
- Tier2Route --> LoadGuides
27
- Tier3Route --> LoadGuides
28
-
29
- LoadGuides --> FactCheck{External Claims / Estimates?}
30
- FactCheck -->|Yes| FactReminder["Append Fact-Audit Reminder"]
31
- FactCheck -->|No| FinalizeOutput["Finalize Routing Checkpoint Output"]
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 illustrates how the `harness-everything` 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.
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 -->|Keyword Matches| Guides["Synergistic Workflow Guides"]
49
-
50
- Guides -->|TDD/Test/Bug| Ch1["tdd + environment-detection + verify-before-claim + verification-loop"]
51
- Guides -->|Git/Commit/PR| Ch2["git-commit + rewrite-commits + using-git-worktrees + verification-loop"]
52
- Guides -->|Agent/Fable/Macro| Ch3["fable-mode + fable-discipline + multi-agent-workspace"]
53
- Guides -->|Refactor/Architecture| Ch4["improve-codebase-architecture + grill-with-docs + grill-me + fable-mode"]
54
-
55
- Ch1 --> ADHD["Always-On ADHD-Friendly Output Shaping (Global Normalization)"]
56
- Ch2 --> ADHD
57
- Ch3 --> ADHD
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 ADHD fill:#1abc9c,stroke:#16a085,stroke-width:2px,color:#ffffff
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["tier-router.js executes"]
73
- Router1 --> TrapCheck["Trap Avoided: Feature request correctly blocked from Tier 1 degrade"]
74
- TrapCheck --> Triage2["Triaged as Tier 2: Standard Task"]
75
- Triage2 --> DomainSummon["Load 'tdd' & frontend Domain Experts"]
76
- DomainSummon --> BaseLoop["Initialize 'todo-driven-workflow' checklist"]
77
- BaseLoop --> VerifyGate["Complete feature & run 'verification-loop' pre-delivery gate"]
78
- VerifyGate --> Done1([Feature delivered safely with proof])
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 --> RecGuides["Auto-load: improve-codebase-architecture, grill-with-docs, fable-mode"]
83
- RecGuides --> Process["Developer completes Grilling session to finalize ADRs"]
84
- Process --> Execute["fable-mode generates execution checklist & spawns sub-agents"]
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
- - [ ] **Physical Boundary Verification**: The skill boundaries are respected and do not leak context.
94
- - [ ] **State Checkpoint Verification**: The active state is established, validated, and recorded at the beginning and end of each execution branch.
95
- - [ ] **Cognitive Alignment**: The skill conforms to the **Think > Try > Summarize > Record** cognitive loop.
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 deepening opportunities in the codebase, consolidating tightly-coupled modules and mapping dependencies visually using Mermaid diagram reports.
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
- Start([Audit Request / Refactoring / SRP Object Splitting]) --> ScanDirectories["Scan code directories, CONTEXT.md & ADRs"]
14
- ScanDirectories --> IdentifyTarget["Identify Monolithic Objects (>300 lines) or Shallow Modules"]
15
- IdentifyTarget --> FormulatePlan["Formulate Deepening & SRP Object Extraction Plan"]
16
- FormulatePlan --> Propose["Present Deepening & SRP Proposal to User"]
17
- Propose --> UserApproved{"User Approves Proposal?"}
18
-
19
- UserApproved -->|Yes| CheckTests{"Existing Test Safety Net Present?"}
20
- UserApproved -->|No| AdjustPlan["Adjust Proposal Scope"] --> Propose
21
-
22
- CheckTests -->|No Tests| WriteCharTests["Write Characterization Tests First"] --> ExecuteTDD
23
- CheckTests -->|Tests Present| ExecuteTDD["Execute Object Extraction via TDD"]
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
- Router["harness-everything / tier-router.js"] -->|Keyword: refactor / architecture / couple| ICA["improve-codebase-architecture / SKILL.md"]
39
- ICA -->|Deductions challenged by SRE via| GrillMe["grill-me / SKILL.md"]
40
- ICA -->|Guides large-scale structural rewrites in| Fable["fable-mode / SKILL.md"]
41
- ICA -->|Extracts interfaces to simplify unit tests in| TDD["tdd / SKILL.md"]
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
- Start["Monolithic file 'utils.js' handles email, token creation, DB pooling, and logging"] --> Trigger["improve-codebase-architecture skill analyzed"]
53
- Trigger --> Audit["Analyzes dependency graphs and calculates coupling scores"]
54
- Audit --> FindSeams["Identifies three distinct interfaces: IEmailService, ITokener, IDbPool"]
55
- FindSeams --> GenMermaid["Output detailed Mermaid diagram visualizing the proposed separated structure"]
56
- GenMermaid --> RefactorPlan["Drafts multi-stage module extraction plan"]
57
- RefactorPlan --> Done([Clear, modular architectural blueprint established])
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
- ## 4. Verification Check
50
+ Deep detail: `improve-codebase-architecture/references/README.md`.
63
51
 
64
- To ensure that the `improve-codebase-architecture` skill is operating in strict compliance with Harness OS design laws, verify the following:
52
+ ## 4. Verification Check
65
53
 
66
- - [ ] **Physical Boundary Verification**: The skill boundaries are respected and do not leak context.
67
- - [ ] **State Checkpoint Verification**: The active state is established, validated, and recorded at the beginning and end of each execution branch.
68
- - [ ] **Cognitive Alignment**: The skill conforms to the **Think > Try > Summarize > Record** cognitive loop.
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
- > Automates the installation of the Agent Cognitive Loop (Think > Try > Summarize > Record) into the user's active workspace and environment configs.
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([Bootstrap Hook Triggered]) --> DetectTargetEnv["Scan for active IDE / Client config paths"]
14
- DetectTargetEnv --> InjectAdvisoryRules["Append advisory rules to .cursorrules, .github/copilot-instructions.md, or AGENTS.md"]
15
- InjectAdvisoryRules --> InstallHooks["Configure Claude Code settings.json hook pre-flights"]
16
- InstallHooks --> DeployScripts["Deploy core bootstrap.js, self-heal.js, and tier-router.js scripts"]
17
- DeployScripts --> RunVerification["Execute self-heal audit test to confirm platform integrations"]
18
- RunVerification --> End([Harness cognitive guardrails fully established])
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
- BootstrapCmd["Bootstrap CLI Command / npm install"] --> InstallSkill["install-cognitive-os / SKILL.md"]
30
- InstallSkill -->|Deploys core router script| Router["harness-everything / scripts / tier-router.js"]
31
- InstallSkill -->|Establishes memory loop configs for| Evolve["self-evolve / SKILL.md"]
32
- InstallSkill -->|Guards all file edits using| Todo["todo-driven-workflow / SKILL.md"]
33
- InstallSkill -->|Enforces Always-On Normalization for all responses| ADHD["Always-On ADHD-Friendly Output Shaping"]
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
- Start["Fresh repository checkout"] --> Trigger["Run 'node scripts/installer.js install --all --yes'"]
45
- Trigger --> Scan["Detects Cursor editor rules and GitHub action configurations"]
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
- - [ ] **Physical Boundary Verification**: The skill boundaries are respected and do not leak context.
59
- - [ ] **State Checkpoint Verification**: The active state is established, validated, and recorded at the beginning and end of each execution branch.
60
- - [ ] **Cognitive Alignment**: The skill conforms to the **Think > Try > Summarize > Record** cognitive loop.
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
- > Generates high-quality, professional README.md and AGENTS.md files based on actual workspace structures and product-archetype templates.
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
- Start([Generate / Update Repository Docs]) --> AuditProjectStructure["Audit workspace directory tree & build configs"]
14
- AuditProjectStructure --> CheckExisting{Existing README / AGENTS File Found?}
15
-
16
- CheckExisting -->|Yes| ReadOld["Read Existing File & Extract Bespoke Notes (env vars, URLs, gotchas)"]
17
- CheckExisting -->|No| ClassifyProductArchetype["Classify repository archetype"]
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
- Router["harness-everything / tier-router.js"] -->|Keyword: doc / readme / agents-template| RepoDocs["repo-docs / SKILL.md"]
36
- RepoDocs -->|Integrates frontmatter constraints into| BMAS["multi-agent-workspace / SKILL.md"]
37
- RepoDocs -->|Leverages ADR details generated in| GWD["grill-with-docs / SKILL.md"]
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
- Start["New library lacks onboarding docs and setup details"] --> Trigger["repo-docs skill invoked"]
49
- Trigger --> Scan["Scans folders: discovers it's a TypeScript utility package"]
50
- Scan --> MatchTemplate["Loads library archetype README template"]
51
- MatchTemplate --> GenDocs["Outputs README.md with TypeScript usage examples, badges, and structure"]
52
- GenDocs --> GenOnboarding["Outputs AGENTS.md defining the developer agent rules for the repo"]
53
- GenOnboarding --> Done([Clean, standardized documentation committed])
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
- ## 4. Verification Check
43
+ Deep detail: `repo-docs/references/process-guide.md`.
59
44
 
60
- To ensure that the `repo-docs` skill is operating in strict compliance with Harness OS design laws, verify the following:
45
+ ## 4. Verification Check
61
46
 
62
- - [ ] **Physical Boundary Verification**: The skill boundaries are respected and do not leak context.
63
- - [ ] **State Checkpoint Verification**: The active state is established, validated, and recorded at the beginning and end of each execution branch.
64
- - [ ] **Cognitive Alignment**: The skill conforms to the **Think > Try > Summarize > Record** cognitive loop.
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
@@ -1,60 +1,64 @@
1
1
  # Workflow: Rewrite Commits
2
2
 
3
- > Safely rewrites or squashes a specified range of commits into highly professional, Conventional Commits (Angular style) on a new branch.
3
+ > Rewrites past Git history into Angular Style messages — cleaning unpushed commits before a PR, squashing fixups, rewording, and reordering safely on a temp branch with abort on conflict.
4
+
5
+ Source of truth: `rewrite-commits/SKILL.md`.
4
6
 
5
7
  ---
6
8
 
7
9
  ## 1. Skill Behavior Workflow
8
10
 
9
- This section visualizes how the `rewrite-commits` skill executes internally, detailing the sequence of operations, state transitions, and evaluation steps.
10
-
11
11
  ```mermaid
12
12
  graph TD
13
- Start([Define Commit Range]) --> BackupBranch["Create a backup branch of current state"]
14
- BackupBranch --> ReadCommits["Read all commit messages in the range"]
15
- ReadCommits --> AnalyzeDiffs["Read files & diffs associated with each commit"]
16
- AnalyzeDiffs --> GenNewMessages["Generate high-quality Angular-style messages for each diff"]
17
- GenNewMessages --> SoftReset["Execute git reset --soft to merge range changes"]
18
- SoftReset --> ReapplyCommits["Re-apply changes with perfectly clean, segmented commit history"]
19
- ReapplyCommits --> VerifyBranch["Run verification checks on the final rebuilt branch"]
20
- VerifyBranch --> End([Perfectly clean Git history on new branch])
13
+ DiscoverRange["Discover: git log --oneline -n <num> to confirm range"] --> PushedGuard{"Pushed to remote main/master?"}
14
+ PushedGuard -->|Yes| WarnConfirm["Warn and require secondary human confirmation"]
15
+ PushedGuard -->|No| TempBranch["Create temp branch for rewrite"]
16
+ WarnConfirm --> TempBranch
17
+ TempBranch --> ResetSoft["Rewrite via git reset --soft HEAD~N plus structured commits"]
18
+ ResetSoft --> AngularMsg["Messages follow Angular Style per git-commit skill"]
19
+ AngularMsg --> ConfirmLog["Confirm with git log --oneline"]
20
+ ConfirmLog --> ConflictCheck{"Merge conflict?"}
21
+ ConflictCheck -->|Yes| AbortStop["Run git rebase --abort, STOP, hand to human or zoom-out"]
22
+ ConflictCheck -->|No| DoneHistory["Rewritten Angular-Style history on temp branch"]
21
23
  ```
22
24
 
23
- ---
25
+ ```mermaid
26
+ graph TD
27
+ NoRebaseI["Gate: no bare interactive git rebase -i"] --> ScriptOpt["Use git reset --soft or Node.js scripting, no hardcoded sed -i"]
28
+ ScriptOpt --> DeepRef["Deep dive: rewrite-commits/references/workflow.md"]
29
+ DeepRef --> ConfirmOut["Expected output: temp-branch history confirmed via git log --oneline"]
30
+ ```
24
31
 
25
32
  ## 2. Triggering and Routing Path
26
33
 
27
- This diagram illustrates how the `rewrite-commits` 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.
28
-
29
34
  ```mermaid
30
35
  graph LR
31
- Router["harness-everything / tier-router.js"] -->|Keyword: commit / rewrite / squash| Rewrite["rewrite-commits / SKILL.md"]
32
- Rewrite -->|Supplements convention templates in| GitCommit["git-commit / SKILL.md"]
33
- Rewrite -->|Pre-verify rewritten commits via| VerLoop["verification-loop / SKILL.md"]
36
+ UserReq["User requests cleaning, squashing, or rewriting past history to Angular Style"] --> RewriteSkill["rewrite-commits / SKILL.md"]
37
+ RewriteSkill --> TempOut["Output: rewritten history on temp branch"]
38
+ RewriteSkill --> AbortPath["On conflict: git rebase --abort + handover"]
34
39
  ```
35
40
 
36
- ---
37
-
38
- ## 3. Real-World Use Case Flowchart
39
-
40
- Here we model concrete real-world scenarios and use cases of the `rewrite-commits` skill, illustrating standard success paths, error handling, or recovery loops.
41
-
42
41
  ```mermaid
43
- graph TD
44
- Start["Branch has messy commits: 'fixed stuff', 'more fixes', 'bug'"] --> Trigger["Rewrite-commits skill run for HEAD~3"]
45
- Trigger --> Backup["Backup branch 'backup-feature-x' created"]
46
- Trigger --> GatherDiffs["Analyze total diff across the 3 messy commits"]
47
- GatherDiffs --> Generate完美["Determine changes relate to user auth session handling"]
48
- Generate完美 --> Rebuild["Reset and make 1 perfect commit: 'fix(auth): correct token refresh race condition'"]
49
- Rebuild --> Done([Clean, reviewable PR history ready])
42
+ graph LR
43
+ RewriteSkill2["rewrite-commits / SKILL.md"] -->|Message conventions per| GitCommit["git-commit skill"]
44
+ RewriteSkill2 -->|Conflict handover to| ZoomOut["zoom-out"]
45
+ NewCommitReq["New commits on current work"] -->|Not this skill| GitCommit
46
+ PushedMain["Rewrite of pushed main/master without confirmation"] -->|Blocked| NeedConfirm["Require explicit human confirmation"]
50
47
  ```
51
48
 
52
- ---
49
+ ## 3. Real-World Use Case
53
50
 
54
- ## 4. Verification Check
51
+ A branch has 4 messy unpushed commits before a PR (`wip`, `fix`, `oops`, `final fix`). The user asks to squash to Angular Style. The skill runs `git log --oneline -n 4` to confirm the range, verifies the commits are not pushed to `main`, creates a temp branch, uses `git reset --soft HEAD~4` plus structured recommits with Angular Style messages, then confirms with `git log --oneline`. If a rebase conflict appears, it runs `git rebase --abort`, stops, and hands over for a human decision.
55
52
 
56
- To ensure that the `rewrite-commits` skill is operating in strict compliance with Harness OS design laws, verify the following:
53
+ ## 4. Verification Check
57
54
 
58
- - [ ] **Physical Boundary Verification**: The skill boundaries are respected and do not leak context.
59
- - [ ] **State Checkpoint Verification**: The active state is established, validated, and recorded at the beginning and end of each execution branch.
60
- - [ ] **Cognitive Alignment**: The skill conforms to the **Think > Try > Summarize > Record** cognitive loop.
55
+ - [ ] Range confirmed with `git log --oneline -n <num>` before rewriting
56
+ - [ ] Rewrite done on a temp branch first, not directly on `main` / release branches
57
+ - [ ] No bare interactive `git rebase -i` used; used `git reset --soft HEAD~<N>` or script editors
58
+ - [ ] No hardcoded `sed -i` scripting used
59
+ - [ ] All new messages follow Angular Style per the `git-commit` skill
60
+ - [ ] Final history confirmed with `git log --oneline`
61
+ - [ ] If commits were pushed to remote `main` / `master`, warned and obtained secondary human confirmation
62
+ - [ ] On merge conflict, ran `git rebase --abort`, stopped, and handed over instead of resolving beyond abort
63
+ - [ ] Not used for creating new commits on current work (belongs to `git-commit`)
64
+ - [ ] Deep detail checked in `rewrite-commits/references/workflow.md` where needed