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,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
@@ -1,71 +1,66 @@
1
1
  # Workflow: Verification Loop
2
2
 
3
- > Comprehensive pre-PR quality gate executing builds, linting, type-checking, test suites, and security scans before claiming a task complete.
3
+ > Run the objective gates — build, types, lint, tests, security, diff — and only claim done when the evidence-backed report passes.
4
4
 
5
- ---
5
+ Source of truth: `verification-loop/SKILL.md`.
6
6
 
7
- ## 1. Skill Behavior Workflow
7
+ Contract summary from SKILL.md — Trigger: completed implementation or change awaiting delivery. Output: evidence-backed verification report and delivery decision. USE FOR: verify a feature or change before delivery, run quality gates before a PR. DO NOT USE FOR: fixing failures without re-running the loop, writing new features or tests (use `tdd`).
8
8
 
9
- This section visualizes how the `verification-loop` 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([Pre-PR Quality Check Triggered]) --> RunBuild["1. Phase 1: Build Verification"]
14
- RunBuild --> RunTypeCheck["2. Phase 2: Type Check (tsc / pyright)"]
15
- RunTypeCheck --> RunLint["3. Phase 3: Lint Check"]
16
- RunLint --> RunTests["4. Phase 4: Test Suite Execution"]
17
- RunTests --> RunSecurity["5. Phase 5: Security & Secret Scan"]
18
- RunSecurity --> DiffReview["6. Phase 6: Diff Review"]
19
-
20
- DiffReview --> CheckScript{7. Is verify-gate.js / Template Available?}
21
- CheckScript -->|Yes| ScriptReport["Run harness-everything/scripts/verify-gate.js & Fill Template"]
22
- CheckScript -->|No| DirectReport["Output Verification Report Inline"]
23
-
24
- ScriptReport --> CheckGate{All Verification Gates Passed?}
25
- DirectReport --> CheckGate
26
-
27
- CheckGate -->|No| FixIssues["Fix Issues in Code & Re-verify"] --> RunBuild
28
- CheckGate -->|Yes| End([Pre-PR Verification Gate Cleared])
13
+ Start[Completed Change Awaiting Delivery] --> Build[Gate1 Build npm run build]
14
+ Build --> Types[Gate2 Types tsc noEmit or pyright]
15
+ Types --> Lint[Gate3 Lint npm run lint or ruff]
16
+ Lint --> Tests[Gate4 Tests npm run test coverage]
17
+ Tests --> Security[Gate5 Security Secrets StrayLogs]
18
+ Security --> Diff[Gate6 Diff git diff stat]
19
+ Diff --> Report[Fill verification-report template]
20
+ Report --> Decision{All Gates Pass?}
21
+ Decision -->|yes| Deliver([Delivery Decision Ready])
22
+ Decision -->|no| Fix[Fix Cause Rerun From First Affected Gate]
23
+ Fix --> Build
29
24
  ```
30
25
 
31
- ---
32
-
33
26
  ## 2. Triggering and Routing Path
34
27
 
35
- This diagram illustrates how the `verification-loop` 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.
36
-
37
28
  ```mermaid
38
- graph LR
39
- Router["harness-everything / tier-router.js"] -->|Pre-PR checks / gate| VerLoop["verification-loop / SKILL.md"]
40
- VerLoop -->|Guards finalize step in| Todo["todo-driven-workflow / SKILL.md"]
41
- VerLoop -->|Requires test environment setup from| Env["environment-detection / SKILL.md"]
42
- VerLoop -->|Precedes safe commit push in| GitCommit["git-commit / SKILL.md"]
29
+ graph TD
30
+ VerifyReq[Run Full Verification Loop Request] --> Skill[verification-loop SKILL]
31
+ DeliveryReq[Verify Before Delivery Request] --> Skill
32
+ PRReq[Quality Gates Before PR] --> Skill
33
+ DesignOnly[Design Discussion No Completed Work] --> Decline[Do Not Route]
34
+ PlanOnly[Planning Without Code Changes] --> Decline
35
+ NewWork[Write New Features Tests] --> TDD[tdd SKILL]
36
+ Skill --> Gates[Build Type Lint Test Security Diff]
43
37
  ```
44
38
 
45
- ---
46
-
47
- ## 3. Real-World Use Case Flowchart
48
-
49
- Here we model concrete real-world scenarios and use cases of the `verification-loop` skill, illustrating standard success paths, error handling, or recovery loops.
39
+ ## 3. Real-World Use Case
50
40
 
51
41
  ```mermaid
52
42
  graph TD
53
- Start["Feature code written; ready to claim task complete"] --> Trigger["verification-loop skill runs"]
54
- Trigger --> Build["Run 'npm run build' -> Succeeded"]
55
- Build --> Type["Run 'npm run typecheck' -> Found 2 type mismatches in routes.ts"]
56
- Type --> FixT["Fix incorrect type casting in routes.ts"]
57
- FixT --> Recheck["Re-run typecheck -> Succeeded"]
58
- Recheck --> Lint["Run 'npm run lint' -> Clean"]
59
- Lint --> Tests["Run 'npm run test' -> 24 tests passed"]
60
- Tests --> Done([Verification loop complete; safe to open PR])
43
+ Done[Feature Implemented Awaiting PR] --> B[Run npm run build]
44
+ B -->|pass| T[Run npx tsc noEmit]
45
+ T -->|fail| FixT[Fix Type Errors]
46
+ FixT --> B
47
+ T -->|pass| L[Run npm run lint]
48
+ L -->|pass| TS[Run npm run test coverage]
49
+ TS -->|pass| Sec[Check Secrets And Stray Logs]
50
+ Sec --> D[Check git diff stat For Unintended Changes]
51
+ D --> R[Fill templates verification-report template md]
52
+ R --> PR[Report Evidence And Delivery Decision]
61
53
  ```
62
54
 
63
- ---
55
+ Template: `verification-loop/templates/verification-report.template.md`. Deep dive: `verification-loop/references/verification-phases.md`.
64
56
 
65
57
  ## 4. Verification Check
66
58
 
67
- To ensure that the `verification-loop` skill is operating in strict compliance with Harness OS design laws, verify the following:
68
-
69
- - [ ] **Physical Boundary Verification**: The skill boundaries are respected and do not leak context.
70
- - [ ] **State Checkpoint Verification**: The active state is established, validated, and recorded at the beginning and end of each execution branch.
71
- - [ ] **Cognitive Alignment**: The skill conforms to the **Think > Try > Summarize > Record** cognitive loop.
59
+ - [ ] No completion was claimed until every applicable gate passed
60
+ - [ ] Build gate ran (`npm run build`) with evidence recorded
61
+ - [ ] Type gate ran (`npx tsc --noEmit` or `pyright .`) with evidence recorded
62
+ - [ ] Lint gate ran (`npm run lint` or `ruff check .`) with evidence recorded
63
+ - [ ] Test and coverage gate ran (`npm run test -- --coverage`) with evidence recorded
64
+ - [ ] Security gate checked secrets and stray logs with evidence recorded
65
+ - [ ] Diff gate checked `git diff --stat` and unintended changes with evidence recorded
66
+ - [ ] `templates/verification-report.template.md` was filled with evidence, and any failure was fixed then rerun from the first affected gate rather than patched without a rerun