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.
Files changed (49) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +13 -0
  4. package/README.md +7 -3
  5. package/ci/mechanism-2a-rule-of-3.test.js +71 -0
  6. package/ci/mechanism-2ah-workflow-lifecycle.test.js +139 -0
  7. package/ci/mechanism-2c-state-persist.test.js +45 -2
  8. package/ci/mechanism-2t-issue-20.test.js +0 -8
  9. package/ci/mechanism-30-opencode-plugin-loadability.test.js +39 -7
  10. package/docs/architecture.md +17 -0
  11. package/docs/audit.md +52 -5
  12. package/docs/release-evidence.md +3 -0
  13. package/docs/workflow-runtime.md +13 -0
  14. package/docs/workflows/environment-detection.md +47 -37
  15. package/docs/workflows/eval-harness.md +45 -38
  16. package/docs/workflows/fable-discipline.md +45 -33
  17. package/docs/workflows/git-commit.md +53 -45
  18. package/docs/workflows/grill-me.md +36 -38
  19. package/docs/workflows/grill-with-docs.md +36 -46
  20. package/docs/workflows/harness-everything.md +59 -57
  21. package/docs/workflows/improve-codebase-architecture.md +36 -44
  22. package/docs/workflows/install-cognitive-os.md +36 -29
  23. package/docs/workflows/repo-docs.md +29 -40
  24. package/docs/workflows/rewrite-commits.md +40 -36
  25. package/docs/workflows/security-review.md +34 -53
  26. package/docs/workflows/skill-creator.md +39 -56
  27. package/docs/workflows/skill-style.md +35 -40
  28. package/docs/workflows/using-git-worktrees.md +40 -44
  29. package/docs/workflows/verification-loop.md +43 -48
  30. package/docs/workflows/verify-before-claim.md +37 -40
  31. package/docs/workflows/zoom-out.md +39 -51
  32. package/harness-everything/SKILL.md +1 -1
  33. package/harness-everything/scripts/kernel-router.js +38 -10
  34. package/hooks/scripts/lib/workflow-isolation.js +30 -1
  35. package/hooks/scripts/rule-of-3-tracker.js +17 -9
  36. package/hooks/scripts/state-persist.js +14 -6
  37. package/hooks/scripts/workflow-gate.js +5 -1
  38. package/opencode-plugin/plugin.json +1 -1
  39. package/package.json +1 -1
  40. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  41. package/plugins/harness-everything/hooks/scripts/lib/workflow-isolation.js +30 -1
  42. package/plugins/harness-everything/hooks/scripts/rule-of-3-tracker.js +17 -9
  43. package/plugins/harness-everything/hooks/scripts/state-persist.js +14 -6
  44. package/plugins/harness-everything/hooks/scripts/workflow-gate.js +5 -1
  45. package/plugins/harness-everything/plugin.json +1 -1
  46. package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
  47. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +38 -10
  48. package/docs/issue-20-rollup.md +0 -47
  49. package/docs/reviews/pr-142-issue-131.md +0 -89
@@ -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
@@ -1,77 +1,58 @@
1
1
  # Workflow: Security Review
2
2
 
3
- > Automated security scanning, threat modeling, and input-validation reviews to identify potential security holes and enforce robust safety guardrails.
3
+ > Runs STRIDE threat modeling, scans secrets with the audit script, and hardens code against OWASP Top 10 risks using three-tier boundary controls — for auth, inputs, uploads, secrets, and pre-deploy audits.
4
+
5
+ Source of truth: `security-review/SKILL.md`.
4
6
 
5
7
  ---
6
8
 
7
9
  ## 1. Skill Behavior Workflow
8
10
 
9
- This section visualizes how the `security-review` skill executes internally, detailing the sequence of operations, state transitions, and evaluation steps.
10
-
11
11
  ```mermaid
12
12
  graph TD
13
- Start([Code Refactoring / Feature Done / Security Audit]) --> STRIDE["1. STRIDE Threat Modeling & Abuse Case Design"]
14
- STRIDE --> CheckScript{2. Is audit-secrets.js Executable?}
15
-
16
- CheckScript -->|Yes| RunAudit["Run node security-review/scripts/audit-secrets.js"]
17
- CheckScript -->|No / Fails| GrepFallback["Scan Workspace Secrets & Inputs via grep_search"]
18
-
19
- RunAudit --> CheckVun{3. Detect Vulnerabilities or Leaks?}
20
- GrepFallback --> CheckVun
21
-
22
- CheckVun -->|Hardcoded Secrets| FixSecrets["Always Do: Refactor to process.env & .env.local"]
23
- CheckVun -->|SQL Concatenation| FixSQL["Always Do: Refactor to Parameterized Queries / ORM"]
24
- CheckVun -->|Unvalidated Input| FixInput["Always Do: Add Zod Schema Validation"]
25
- CheckVun -->|High-Risk Auth Shift| AskUser["Ask First: Require User Approval for Auth Shift"]
26
-
27
- FixSecrets --> CompileSecurityReport["4. Compile Security Audit Report"]
28
- FixSQL --> CompileSecurityReport
29
- FixInput --> CompileSecurityReport
30
- AskUser -->|Approved| CompileSecurityReport
31
- CheckVun -->|Clean| CompileSecurityReport
32
-
33
- CompileSecurityReport --> ResolveReportPath{5. Resolve Audit Report Path}
34
- ResolveReportPath -->|docs/ Exists| WriteDocs["Save to docs/security-audit.md"]
35
- ResolveReportPath -->|Protected / No Folder| WritePlatform["Save to .github/harness-everything/security-audit.md"]
36
-
37
- WriteDocs --> End([Codebase hardened and verified secure])
38
- WritePlatform --> End
13
+ ThreatModel["Threat-model with STRIDE per guides/STRIDE-THREAT-MODEL.md; misuse-case every endpoint and input"] --> SecretScan["Scan secrets and injection risks with audit script"]
14
+ SecretScan --> FixHarden["Fix findings per boundary system"]
15
+ FixHarden --> AuditReport["Write audit report to docs or platform dir"]
16
+ AuditReport --> DoneSecure["Codebase hardened; report recorded"]
39
17
  ```
40
18
 
41
- ---
19
+ ```mermaid
20
+ graph TD
21
+ ScanCmd["Run node security-review/scripts/audit-secrets.js"] --> ScanGate["Gate: secret scan via script or grep before concluding"]
22
+ ScanGate --> AlwaysDo["Always Do: parameterize SQL, Zod-validate inputs, httpOnly cookies, secrets to process.env"]
23
+ AlwaysDo --> NeverDo["Never Do: no hardcoded secrets, no password logging, no eval or unescaped innerHTML"]
24
+ NeverDo --> ReportPath["Report to docs/security-audit.md or .github/harness-everything/security-audit.md"]
25
+ ```
42
26
 
43
27
  ## 2. Triggering and Routing Path
44
28
 
45
- This diagram illustrates how the `security-review` 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.
46
-
47
29
  ```mermaid
48
30
  graph LR
49
- Router["harness-everything / tier-router.js"] -->|Pre-flight / Quality PR reviews| SecReview["security-review / SKILL.md"]
50
- SecReview -->|Informs security tests written in| TDD["tdd / SKILL.md"]
51
- SecReview -->|Integrated as mandatory PR gate in| VerLoop["verification-loop / SKILL.md"]
31
+ AuthReq["AuthN or authZ implementation"] --> SecSkill["security-review / SKILL.md"]
32
+ InputReq["User input, uploads, new API endpoints"] --> SecSkill
33
+ SecretReq["Secrets, credentials, payment features"] --> SecSkill
34
+ AuditReq["Security audit before production deploy"] --> SecSkill
52
35
  ```
53
36
 
54
- ---
55
-
56
- ## 3. Real-World Use Case Flowchart
57
-
58
- Here we model concrete real-world scenarios and use cases of the `security-review` skill, illustrating standard success paths, error handling, or recovery loops.
59
-
60
37
  ```mermaid
61
- graph TD
62
- Start["New search feature: executes system shell query using raw user input string"] --> Trigger["security-review skill runs"]
63
- Trigger --> Scan["Flags potential command injection vulnerability in search.js"]
64
- Scan --> Propose["Propose input sanitization and switching to child_process.execFile with argument array"]
65
- Propose --> Implement["Refactor code to use safe argument arrays instead of raw string shell execution"]
66
- Implement --> Done([Critical remote code execution vulnerability resolved])
38
+ graph LR
39
+ SecSkill2["security-review / SKILL.md"] -->|Produces| ThreatOut["Threat model + scan + hardened code + audit report"]
40
+ PerfReq["Performance profiling"] -->|Out of scope| NotSec["Not security-review"]
41
+ A11yReq["Accessibility or UI styling fixes"] -->|Out of scope| NotSec
42
+ PlainReview["Code review without security scope"] -->|Out of scope| NotSec
67
43
  ```
68
44
 
69
- ---
45
+ ## 3. Real-World Use Case
70
46
 
71
- ## 4. Verification Check
47
+ A new profile endpoint accepts a username and avatar upload before a production deploy. The skill threat-models it with STRIDE, misuse-cases the input and upload path, runs `node "security-review/scripts/audit-secrets.js"`, finds an unvalidated input and a hardcoded secret, fixes them per the boundary system (Zod validation, secret moved to `process.env`, parameterized query), and writes the report to `<workspace>/docs/security-audit.md`, falling back to `<workspace>/.github/harness-everything/security-audit.md` when `docs/` is protected or absent.
72
48
 
73
- To ensure that the `security-review` skill is operating in strict compliance with Harness OS design laws, verify the following:
49
+ ## 4. Verification Check
74
50
 
75
- - [ ] **Physical Boundary Verification**: The skill boundaries are respected and do not leak context.
76
- - [ ] **State Checkpoint Verification**: The active state is established, validated, and recorded at the beginning and end of each execution branch.
77
- - [ ] **Cognitive Alignment**: The skill conforms to the **Think > Try > Summarize > Record** cognitive loop.
51
+ - [ ] STRIDE threat model completed per `security-review/guides/STRIDE-THREAT-MODEL.md`, with misuse-case for every endpoint and input
52
+ - [ ] Secret and injection scan run via `security-review/scripts/audit-secrets.js`, or grep, before concluding
53
+ - [ ] OWASP patterns checked per `security-review/guides/OWASP-PATTERNS.md` and `security-review/references/security-checklist.md`
54
+ - [ ] Always Do applied: parameterized SQL, Zod-validated inputs, httpOnly cookies, secrets in `process.env`
55
+ - [ ] Ask First respected: CORS changes, auth and login flows, file uploads, rate limits
56
+ - [ ] Never Do respected: no committed hardcoded secrets, no logged passwords or tokens, no `eval()` or unescaped `innerHTML`
57
+ - [ ] Audit report written to `<workspace>/docs/security-audit.md`, or `<workspace>/.github/harness-everything/security-audit.md` when docs is protected or absent
58
+ - [ ] Scope kept to auth, inputs, uploads, endpoints, secrets, and audits — not general review, performance, or UI styling
@@ -1,80 +1,63 @@
1
1
  # Workflow: Skill Creator
2
2
 
3
- > Authors, audits, and evolves SKILL.md files against a single quality bar — the Skill Contract format plus predictability/pruning/progressive-disclosure principles from external skill-writing research — and is the required gate for skills `self-evolve` generates dynamically.
3
+ > Authors, audits, and refactors SKILL.md files against the Skill Contract quality bar — for new skills, SKILL.md refactors, overlap checks, and packaging insights as dynamic skills.
4
+
5
+ Source of truth: `skill-creator/SKILL.md`.
4
6
 
5
7
  ---
6
8
 
7
9
  ## 1. Skill Behavior Workflow
8
10
 
9
- This section visualizes how the `skill-creator` skill executes internally, detailing the sequence of operations, state transitions, and evaluation steps.
10
-
11
11
  ```mermaid
12
12
  graph TD
13
- Start([New skill request / existing SKILL.md to audit / self-evolve dynamic-generation call after LLM selection]) --> Intent["Capture intent: what it does, the one canonical description sentence, which Tier, does an existing skill already own this ground"]
14
- Intent --> Draft["Draft: Skill Contract table first, then body sized by information hierarchy (steps vs flat reference vs guides/references)"]
15
- Draft --> Test["Test 2-3 realistic prompts via multi-agent-workspace: with-skill subagent vs baseline subagent"]
16
- Test --> Checklist{"Quality Checklist (§3): SSOT, no duplication >5 lines, every MUST has a real gate, no no-ops, info hierarchy, leading words reused, checkable completion criteria, human-facing description"}
17
- Checklist -->|Fails| Prune["Prune and rewrite the failing item"]
18
- Prune --> Checklist
19
- Checklist -->|Passes| Route{Static or dynamic?}
20
- Route -->|Static| Register["Register: harness-everything §5 row + tier-router.js keyword line"]
21
- Route -->|Dynamic, from self-evolve| DynamicContract["§4 Dynamic Skill Generation Contract: write to .claude/harness-everything/skills/generated/<name>/ & register-dynamic-skill.js to manifest.json, metadata.type=dynamic, status=draft"]
22
- Register --> End([Skill live in the repo, single source of truth for its own description])
23
- DynamicContract --> End
13
+ NewReq["Trigger: new skill, SKILL.md audit, or self-evolve packaging"] --> DupGrep["Grep registry for near-duplicates; when-to-fire sentence becomes description"]
14
+ DupGrep --> DraftContract["Draft Contract table first, then USE FOR and DO NOT USE FOR, then steps or flat reference"]
15
+ DraftContract --> PushRef["Push branch-only detail to references/"]
16
+ PushRef --> ABTest["A/B-test via multi-agent-workspace subagents; read both transcripts"]
17
+ ABTest --> QualityGate["Quality Checklist gate before registering"]
18
+ QualityGate --> RegisterOut["Output: SKILL.md passing Quality Checklist; writes SKILL.md and updates registry or generated folder"]
24
19
  ```
25
20
 
26
- ---
21
+ ```mermaid
22
+ graph TD
23
+ DynamicReq["Dynamic path: only generalizable procedures qualify"] --> SimpleRule["Simple constraints go to memories/repo/RULES.md"]
24
+ SimpleRule --> DynLoc["Location: workspace/.claude/harness-everything/skills/generated/kebab-case-name/SKILL.md"]
25
+ DynLoc --> DynFront["Frontmatter: triggers, type generated, source, status draft"]
26
+ DynFront --> DynLife["Lifecycle: draft to active after firing elsewhere; deprecate, do not delete; promote once proven general"]
27
+ ```
27
28
 
28
29
  ## 2. Triggering and Routing Path
29
30
 
30
- This diagram illustrates how `skill-creator` 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.
31
-
32
31
  ```mermaid
33
32
  graph LR
34
- Router["harness-everything / tier-router.js"] -->|Keyword: skill / skill.md / new skill / write a skill| Creator["skill-creator / SKILL.md"]
35
- Creator -->|Table shape spec| SkillStyle["skill-style / SKILL.md"]
36
- Creator -->|With/without test subagents| Launcher["multi-agent-workspace / SKILL.md"]
37
- Creator -->|Registers new static skills into| Registry["harness-everything / SKILL.md §5"]
38
- Evolve["self-evolve / SKILL.md §4"] -->|LLM decides to promote insight| Creator
39
- Creator -->|Writes dynamic skills to| Generated[".claude/harness-everything/skills/generated/"]
40
- Generated -->|Registered in| Manifest["manifest.json 'generated' registry"]
41
- Manifest -->|Matched & auto-loaded by| Router
33
+ CreateReq["Create a skill from scratch"] --> CreatorSkill["skill-creator / SKILL.md"]
34
+ AuditReq["Audit or refactor a SKILL.md; check overlap"] --> CreatorSkill
35
+ PackageReq["Packaging a session insight as a dynamic skill"] --> CreatorSkill
36
+ CreatorSkill --> ChecklistOut["Gate: Quality Checklist, incl. USE FOR and DO NOT USE FOR"]
42
37
  ```
43
38
 
44
- ---
45
-
46
- ## 3. Real-World Use Case Flowchart
47
-
48
- Here we model concrete real-world scenarios and use cases of the `skill-creator` skill, illustrating standard success paths, error handling, or recovery loops — one for a human-directed static skill, one for `self-evolve`'s dynamic path.
49
-
50
39
  ```mermaid
51
- graph TD
52
- Start1["Developer: 'I want a skill for deploying to AWS'"] --> Intent1["skill-creator §2 Step 1: capture intent, one canonical description sentence"]
53
- Intent1 --> Draft1["Draft Skill Contract table + steps, push detail to deploy-aws/guides/"]
54
- Draft1 --> Test1["Spawn with/without subagents via multi-agent-workspace on 2-3 realistic prompts"]
55
- Test1 --> Check1{Quality Checklist passes?}
56
- Check1 -->|No| Fix1["Fix flagged item, re-test"]
57
- Fix1 --> Check1
58
- Check1 -->|Yes| Reg1["Add row to harness-everything §5 + one line to tier-router.js"]
59
- Reg1 --> Done1([deploy-aws/SKILL.md live as a static, reviewed skill])
60
-
61
- Start2["zoom-out recovery ends: root cause found for a recurring connection-pool exhaustion bug"] --> Decide2{"LLM: Does it warrant a standalone complex skill?"}
62
- Decide2 -->|No: Simple Tip| Save2["persist-memory.js writes simple rule to RULES.md"]
63
- Decide2 -->|Yes: Complex Skill| Trigger2["self-evolve §3 Step 3: Promote to Dynamic Skill"]
64
- Trigger2 --> Load2["self-evolve MUST load skill-creator §4 before writing anything"]
65
- Load2 --> Gate2{Quality Checklist §3 passes?}
66
- Gate2 -->|No| Reject2["Do not persist — this checklist is the only review a dynamic skill gets"]
67
- Gate2 -->|Yes| Write2["Write .claude/harness-everything/skills/generated/orm-transaction-batching/SKILL.md & run register-dynamic-skill.js"]
68
- Write2 --> Done2([Dynamic skill available next session via manifest registration and tier-router.js scan])
69
- Save2 --> Done3([Simple memory rule available in RULES.md])
40
+ graph LR
41
+ CreatorSkill2["skill-creator / SKILL.md"] -->|A-B tests with| MultiAgent["multi-agent-workspace subagents"]
42
+ NonSkillDocs["Non-skill project docs"] -->|Use instead| RepoDocs["repo-docs or to-spec"]
43
+ ThirdParty["Third-party skill discovery"] -->|Use instead| FindSkills["find-skills"]
44
+ StyleOnly["Code style outside SKILL.md files"] -->|Out of scope| NotCreator["Not skill-creator"]
70
45
  ```
71
46
 
72
- ---
47
+ ## 3. Real-World Use Case
73
48
 
74
- ## 4. Verification Check
49
+ A team wants a new `deploy-preview` skill. The author greps the registry for near-duplicates, writes the when-to-fire sentence as the description, drafts the Contract table first with its enforcement gate, then `USE FOR` and `DO NOT USE FOR`, then the steps, pushing long detail to `references/`. They A/B-test via `multi-agent-workspace` subagents, read both transcripts, run the Quality Checklist (`skill-creator/references/quality-checklist.md`), and only then register. A separate small tip discovered mid-session does not qualify as a dynamic skill and goes to `<workspace>/memories/repo/RULES.md`.
75
50
 
76
- To ensure that the `skill-creator` skill is operating in strict compliance with Harness OS design laws, verify the following:
51
+ ## 4. Verification Check
77
52
 
78
- - [ ] **Physical Boundary Verification**: The skill boundaries are respected and do not leak context.
79
- - [ ] **State Checkpoint Verification**: The active state is established, validated, and recorded at the beginning and end of each execution branch.
80
- - [ ] **Cognitive Alignment**: The skill conforms to the **Think > Try > Summarize > Record** cognitive loop.
53
+ - [ ] Registry grep for near-duplicates completed; description written as the when-to-fire sentence
54
+ - [ ] Contract table drafted first to force the enforcement gate
55
+ - [ ] `USE FOR` and `DO NOT USE FOR` present before steps or flat reference
56
+ - [ ] Branch-only detail pushed to `references/` (e.g. `skill-creator/references/quality-checklist.md`)
57
+ - [ ] A/B-tested via `multi-agent-workspace` subagents and both transcripts read
58
+ - [ ] Quality Checklist passed before registering, including `USE FOR` / `DO NOT USE FOR` consistency
59
+ - [ ] Output is a SKILL.md passing the Quality Checklist; `<skill>/SKILL.md` written and registry or generated folder updated
60
+ - [ ] Dynamic path gated by Quality Checklist first; location, frontmatter triggers, generated type, and draft status correct
61
+ - [ ] Dynamic lifecycle respected: draft to active after firing elsewhere; deprecate, do not delete; promote once proven general
62
+ - [ ] Only generalizable procedures kept as skills; simple constraints sent to `<workspace>/memories/repo/RULES.md`
63
+ - [ ] Not misused for non-skill docs, third-party discovery, or code style outside SKILL.md files
@@ -1,64 +1,59 @@
1
1
  # Workflow: Skill Style
2
2
 
3
- > Guidelines and style rules for authoring, refactoring, and maintaining SKILL.md files to enforce clean frontmatter and logical boundaries.
3
+ > Applies the Harness writing standard to SKILL.md files — covering new skills, structure reviews, naming and frontmatter conventions, tone, formatting, and progressive disclosure across the catalog.
4
+
5
+ Source of truth: `skill-style/SKILL.md`.
4
6
 
5
7
  ---
6
8
 
7
9
  ## 1. Skill Behavior Workflow
8
10
 
9
- This section visualizes how the `skill-style` skill executes internally, detailing the sequence of operations, state transitions, and evaluation steps.
10
-
11
11
  ```mermaid
12
12
  graph TD
13
- Start([Authoring / Editing a SKILL.md]) --> ParseFrontmatter["Parse and validate YAML Frontmatter: name, description"]
14
- ParseFrontmatter --> ValidateBoundary["Check for explicit physical boundaries & state checkpoints"]
15
- ValidateBoundary --> VerifyCognitiveLoop["Verify integration with Cognitive Loop laws"]
16
- VerifyCognitiveLoop --> CheckFormatting["Ensure clean markdown layout and bullet-style rules"]
17
- CheckFormatting --> FormatApproved{Complies with STYLE.md?}
18
- FormatApproved -->|No| FixSkillFile["Refactor and clean file formatting"]
19
- FormatApproved -->|Yes| SaveSkillFile["Commit clean, validated SKILL.md"]
20
- FixSkillFile --> SaveSkillFile
21
- SaveSkillFile --> End([Skill document aligned with professional guidelines])
13
+ TriggerEdit["Trigger: creating, reviewing, or refactoring a Harness SKILL.md"] --> FrontAccurate["Keep frontmatter accurate and description routeable"]
14
+ FrontAccurate --> OrderCheck["Include in order: title, introduction, Skill Contract, usage, actionable rules"]
15
+ OrderCheck --> ImperativeGate["Use imperative language and name the enforcing command or gate"]
16
+ ImperativeGate --> OverlapCheck["Avoid overlap with OS-layer routing or domain expertise"]
17
+ OverlapCheck --> ConsistencyGate["Gate: npm run test:consistency plus style-guide review"]
18
+ ConsistencyGate --> ConciseOut["Output: concise, complete, non-overlapping SKILL.md"]
22
19
  ```
23
20
 
24
- ---
21
+ ```mermaid
22
+ graph TD
23
+ StyleGuide["Deep dive: skill-style/references/style-guide.md"] --> ToneFormat["Standardize tone, formatting, and progressive disclosure"]
24
+ ToneFormat --> NoMutate["State mutations: none; writing and review standard only"]
25
+ NoMutate --> OverlapAvoid["No overlap with existing catalog entries"]
26
+ ```
25
27
 
26
28
  ## 2. Triggering and Routing Path
27
29
 
28
- This diagram illustrates how `skill-style` is reached — as of the `skill-creator` split, it is no longer the first stop. `tier-router.js`'s `/\bskill\b|skill\.md|new skill|write a skill/` match now recommends `skill-creator` first (the full authoring/audit/testing workflow) and `skill-style` second (the terse Skill Contract table shape it builds on) — see `harness-everything/scripts/tier-router.js`.
29
-
30
30
  ```mermaid
31
31
  graph LR
32
- Router["harness-everything / tier-router.js"] -->|Keyword: skill / skill.md / new skill| Creator["skill-creator / SKILL.md"]
33
- Creator -->|Builds on the table shape defined in| SkillStyle["skill-style / SKILL.md"]
34
- SkillStyle -->|Audits format correctness of| OtherSkills["Any SKILL.md in the workspace"]
35
- SkillStyle -->|Pre-PR validation gate integration| VerLoop["verification-loop / SKILL.md"]
32
+ NewSkillReq["Creating a new SKILL.md file"] --> StyleSkill["skill-style / SKILL.md"]
33
+ RefactorReq["Refactoring or reviewing an existing SKILL.md"] --> StyleSkill
34
+ ToneReq["Deciding tone, structure, or enforcement style"] --> StyleSkill
35
+ OverlapReq["Checking overlap with an existing skill"] --> StyleSkill
36
36
  ```
37
37
 
38
- ---
39
-
40
- ## 3. Real-World Use Case Flowchart
41
-
42
- §1 already walks the linear audit steps for a single file. This section instead shows the case that motivated splitting `skill-creator` out of this skill in the first place: a developer who needs the *fuller* workflow, not just the table shape.
43
-
44
38
  ```mermaid
45
- graph TD
46
- Start["Developer: 'help me write a new skill for deploying to AWS'"] --> Router["tier-router.js recommends skill-creator + skill-style"]
47
- Router --> Creator["skill-creator: capture intent, draft, test against real prompts (§2)"]
48
- Creator --> StyleCheck["skill-style: does the draft's Skill Contract table match the required shape?"]
49
- StyleCheck -->|Missing/malformed table| Fix["Fix table shape per skill-style, re-run skill-creator's Quality Checklist"]
50
- StyleCheck -->|Table shape OK| Checklist["skill-creator §3 Quality Checklist: no-op / duplication / negation / progressive-disclosure checks"]
51
- Fix --> Checklist
52
- Checklist --> Register["Register in harness-everything §5 + tier-router.js (skill-creator §2 Step 4)"]
53
- Register --> Done([deploy-aws/SKILL.md committed, consistent with the rest of the repo])
39
+ graph LR
40
+ StyleSkill2["skill-style / SKILL.md"] -->|For intent interviews, drafting, prompt tests| CreatorSkill["skill-creator / SKILL.md"]
41
+ DynRoute["Routing rules for dynamically generated mid-session skills"] -->|Owned by| SelfEvolve["self-evolve"]
42
+ NonHarness["Non-Harness skill formats outside harness-everything"] -->|Out of scope| NotStyle["Not skill-style"]
54
43
  ```
55
44
 
56
- ---
45
+ ## 3. Real-World Use Case
57
46
 
58
- ## 4. Verification Check
47
+ An author drafts a new `backup-restore` SKILL.md and runs a style pass. They tighten the frontmatter description for routing, reorder the file to title, introduction, Skill Contract, usage, and actionable rules, rewrite vague advice in imperative language naming `npm run test:consistency` as the gate, remove duplicated routing already owned elsewhere, and check `skill-style/references/style-guide.md`. Intent interviewing and prompt testing are handed to `skill-creator/SKILL.md` per the Core Rules.
59
48
 
60
- To ensure that the `skill-style` skill is operating in strict compliance with Harness OS design laws, verify the following:
49
+ ## 4. Verification Check
61
50
 
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.
51
+ - [ ] Frontmatter accurate and description routeable
52
+ - [ ] File includes in order: title, introduction, Skill Contract, usage, and actionable rules
53
+ - [ ] Imperative language used with the enforcing command or gate named (`npm run test:consistency` plus style-guide review)
54
+ - [ ] No overlap with OS-layer routing or domain expertise; catalog overlap checked
55
+ - [ ] Tone, formatting, and progressive disclosure standardized per `skill-style/references/style-guide.md`
56
+ - [ ] State mutations are none — treated as a writing and review standard only
57
+ - [ ] Intent interviews, drafting, and prompt tests routed to `skill-creator/SKILL.md`, not handled here
58
+ - [ ] Routing rules for dynamically generated mid-session skills left to `self-evolve`
59
+ - [ ] Not applied to non-Harness skill formats outside `harness-everything`
@@ -1,67 +1,63 @@
1
1
  # Workflow: Using Git Worktrees
2
2
 
3
- > Manages isolated workspace environments in parallel using native Git Worktrees, enabling developers to switch contexts safely without stashing or losing unsaved progress.
3
+ > Start isolated when feature work needs it: prefer native worktree entry before implementation plans, with raw git worktree as fallback.
4
4
 
5
- ---
5
+ Source of truth: `using-git-worktrees/SKILL.md`.
6
6
 
7
- ## 1. Skill Behavior Workflow
7
+ Contract summary from SKILL.md — USE FOR: Tier 3 / Fable-class mutable engineering, feature work needing isolation, pre-implementation-plan setup. DO NOT USE FOR: nesting inside an existing worktree, read-only analysis with no mutation, branch/merge workflows unrelated to workspace isolation.
8
8
 
9
- This section visualizes how the `using-git-worktrees` skill executes internally, detailing the sequence of operations, state transitions, and evaluation steps.
9
+ ## 1. Skill Behavior Workflow
10
10
 
11
11
  ```mermaid
12
12
  graph TD
13
- Start([Trigger: Need Workspace Isolation]) --> CheckIso{1. Already in Worktree? GIT_DIR != GIT_COMMON}
14
- CheckIso -->|Yes| Setup["3. Project Setup & Dependency Install"]
15
- CheckIso -->|No| CheckNative{2. Native Worktree Tool Available?}
16
-
17
- CheckNative -->|Yes| RunNative["Use Native Worktree Tool"] --> Setup
18
- CheckNative -->|No| RunGit["Try git worktree add .worktrees/branch"]
19
-
20
- RunGit -->|Success| Setup
21
- RunGit -->|Fails / Sandbox Denied| WorkInPlace["Fallback: Work in Place in Current Directory"] --> Setup
22
-
23
- Setup --> RunBaseline["4. Verify Clean Test Baseline"]
24
- RunBaseline --> End([Isolated Workspace Ready])
13
+ Detect[Step0 Detect Isolation] --> Isolated{Already Isolated?}
14
+ Isolated -->|git-dir differs from git-common-dir, no superproject| Setup[Step2 Setup Dependencies]
15
+ Isolated -->|same dirs or needs isolation| NestGuard{Nesting Check}
16
+ NestGuard -->|inside existing worktree| BlockedA[BLOCKED Never Nest]
17
+ NestGuard -->|top-level repo| Create[Step1 Create Enter Worktree]
18
+ Create -->|native EnterWorktree or worktree flag| Setup
19
+ Create -->|fallback git worktree add| Setup
20
+ Create -->|creation-entry failure| BlockedB[BLOCKED Major Mode]
21
+ Setup --> Baseline[Step3 Baseline Tests and Build]
22
+ Baseline --> Ready([Isolated Workspace Ready])
25
23
  ```
26
24
 
27
- ---
28
-
29
25
  ## 2. Triggering and Routing Path
30
26
 
31
- This diagram illustrates how the `using-git-worktrees` 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
27
  ```mermaid
34
- graph LR
35
- Router["harness-everything / tier-router.js"] -->|Keyword: worktree / isolate / checkout| WT["using-git-worktrees / SKILL.md"]
36
- WT -->|Maintains isolation before running tests in| TDDSkill["tdd / SKILL.md"]
37
- WT -->|Protects terminal environment testing in| EnvSkill["environment-detection / SKILL.md"]
28
+ graph TD
29
+ Tier3[Tier3 Fable Mutable Engineering] --> Skill[using-git-worktrees SKILL]
30
+ Feature[Feature Work Needing Isolation] --> Skill
31
+ PrePlan[Pre-Implementation Plan Setup] --> Skill
32
+ Skill --> SkillDetect[Detect Adapted Per environment-detection]
33
+ ReadOnly[Read-Only Analysis No Mutation] --> Decline[Do Not Route]
34
+ Nested[Nesting Inside Existing Worktree] --> Decline
35
+ BranchOnly[Branch Merge Unrelated To Isolation] --> Decline
36
+ SkillDetect --> IsolatedPath[Reuse Or Create Linked Worktree]
38
37
  ```
39
38
 
40
- ---
41
-
42
- ## 3. Real-World Use Case Flowchart
43
-
44
- Here we model concrete real-world scenarios and use cases of the `using-git-worktrees` skill, illustrating standard success paths, error handling, or recovery loops.
39
+ ## 3. Real-World Use Case
45
40
 
46
41
  ```mermaid
47
42
  graph TD
48
- Start["Working on deep feature 'feat-billing' (unstaged edits)"] --> Interrupt["Urgent production hotfix required!"]
49
- Interrupt --> Trigger["using-git-worktrees skill invoked"]
50
- Trigger --> CreateWT["Add worktree: 'git worktree add ../hotfix-auth hotfix-branch'"]
51
- CreateWT --> OpenWT["Open separate workspace editor in ../hotfix-auth"]
52
- OpenWT --> FixBug["Fix auth bug & run verification test"]
53
- FixBug --> CommitWT["Commit fix and push branch"]
54
- CommitWT --> CloseWT["Close editor, run 'git worktree prune'"]
55
- CloseWT --> Resume["Return to original billing workspace with all unsaved files exactly where they were"]
56
- Resume --> Done([Context switched safely with zero stashing friction])
43
+ Request[Feature Branch Requested With Clean Isolation] --> Detect2[Run git rev-parse git-dir common-dir branch superproject]
44
+ Detect2 -->|not isolated| Enter[Enter Native Worktree Else git worktree add]
45
+ Enter --> Setup2[Install Dependencies As Needed]
46
+ Setup2 --> Base2[Run Relevant Tests and Build Before Mutation]
47
+ Base2 -->|pre-existing failures| Surface[Surface Failures Before Implementation]
48
+ Base2 -->|clean| Implement[Proceed With Implementation]
49
+ Surface --> Implement
57
50
  ```
58
51
 
59
- ---
52
+ Ordinary-mode note: only ordinary isolation-needing work may honor an explicit user preference to stay in place after a decline or unsupported environment. Major mode never falls back to the primary tree.
60
53
 
61
- ## 4. Verification Check
54
+ Deep dive: `using-git-worktrees/references/workflow-details.md`.
62
55
 
63
- To ensure that the `using-git-worktrees` skill is operating in strict compliance with Harness OS design laws, verify the following:
56
+ ## 4. Verification Check
64
57
 
65
- - [ ] **Physical Boundary Verification**: The skill boundaries are respected and do not leak context.
66
- - [ ] **State Checkpoint Verification**: The active state is established, validated, and recorded at the beginning and end of each execution branch.
67
- - [ ] **Cognitive Alignment**: The skill conforms to the **Think > Try > Summarize > Record** cognitive loop.
58
+ - [ ] Tier 3 / Fable-class source or artifact mutation occurs only in a verified isolated worktree; otherwise state is `BLOCKED`
59
+ - [ ] No worktree is nested inside an already isolated worktree
60
+ - [ ] Isolation detection used `git rev-parse --git-dir`, `git rev-parse --git-common-dir`, `git branch --show-current`, and `git rev-parse --show-superproject-working-tree`; a submodule counted as a normal repo
61
+ - [ ] Entry preferred native `EnterWorktree`, `/worktree`, or `--worktree` before `git worktree add "$path" -b "$BRANCH_NAME"`; major mode chose an already-ignored or external/sibling path
62
+ - [ ] Creation or entry failure yields `BLOCKED` in major mode; in-place continuation happened only in ordinary mode after explicit decline or unsupported environment
63
+ - [ ] Dependencies were installed as needed, then relevant tests/build ran in the isolated tree with pre-existing failures surfaced before mutation