@ketecode/loom 0.1.0 → 0.2.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 (211) hide show
  1. package/README.md +111 -11
  2. package/agents/code-reviewer/evals/behavior.json +60 -0
  3. package/agents/inbox-triager/AGENT.md +98 -0
  4. package/agents/inbox-triager/evals/triggers.json +16 -0
  5. package/agents/spec-reviewer/AGENT.md +95 -0
  6. package/agents/spec-reviewer/evals/behavior.json +57 -0
  7. package/agents/spec-reviewer/evals/triggers.json +16 -0
  8. package/agents/task-implementer/AGENT.md +89 -0
  9. package/agents/task-implementer/evals/behavior.json +47 -0
  10. package/agents/task-implementer/evals/triggers.json +16 -0
  11. package/bin/kete-loom.js +46 -6
  12. package/commands/brainstorm.md +25 -0
  13. package/commands/debug.md +27 -0
  14. package/commands/dual-review.md +34 -0
  15. package/commands/feature-dev.md +8 -7
  16. package/commands/finish-branch.md +26 -0
  17. package/commands/fix-bug.md +38 -0
  18. package/commands/production-readiness.md +45 -0
  19. package/commands/usage-report.md +43 -0
  20. package/hooks/block-foreground-servers/HOOK.md +34 -0
  21. package/hooks/block-foreground-servers/cases.json +31 -0
  22. package/hooks/block-foreground-servers/hook.js +41 -0
  23. package/hooks/capture-lessons/HOOK.md +24 -0
  24. package/hooks/capture-lessons/hook.js +48 -0
  25. package/hooks/notify-on-stop/HOOK.md +25 -0
  26. package/hooks/notify-on-stop/hook.js +27 -0
  27. package/hooks/protect-lint-config/HOOK.md +29 -0
  28. package/hooks/protect-lint-config/cases.json +18 -0
  29. package/hooks/protect-lint-config/fixtures/.eslintrc.json +1 -0
  30. package/hooks/protect-lint-config/fixtures/.golangci.yml +1 -0
  31. package/hooks/protect-lint-config/fixtures/.prettierrc +1 -0
  32. package/hooks/protect-lint-config/fixtures/.rubocop.yml +1 -0
  33. package/hooks/protect-lint-config/fixtures/biome.json +1 -0
  34. package/hooks/protect-lint-config/fixtures/eslint.config.mjs +1 -0
  35. package/hooks/protect-lint-config/fixtures/ruff.toml +1 -0
  36. package/hooks/protect-lint-config/hook.js +25 -0
  37. package/hooks/read-before-edit/HOOK.md +26 -0
  38. package/hooks/read-before-edit/cases.json +15 -0
  39. package/hooks/read-before-edit/hook.js +50 -0
  40. package/hooks/run.js +22 -6
  41. package/hooks/verify-before-stop/HOOK.md +32 -0
  42. package/hooks/verify-before-stop/hook.js +70 -0
  43. package/mcp/clickhouse.json +11 -0
  44. package/mcp/exa.json +11 -0
  45. package/mcp/firecrawl.json +11 -0
  46. package/mcp/vercel.json +11 -0
  47. package/package.json +6 -4
  48. package/profiles.json +54 -5
  49. package/rules/use-skills.md +23 -0
  50. package/scripts/lib/behavior.js +52 -0
  51. package/scripts/lib/hooks-install.js +9 -7
  52. package/scripts/lib/lint.js +24 -2
  53. package/scripts/lib/mcp-install.js +5 -1
  54. package/scripts/lib/render.js +6 -0
  55. package/scripts/lib/skills.js +1 -0
  56. package/scripts/lib/targets.js +10 -0
  57. package/skills/agent-failure-debugging/SKILL.md +92 -0
  58. package/skills/agent-failure-debugging/evals/triggers.json +16 -0
  59. package/skills/agent-outbound-messaging/SKILL.md +92 -0
  60. package/skills/agent-outbound-messaging/evals/triggers.json +16 -0
  61. package/skills/agent-security/SKILL.md +117 -0
  62. package/skills/agent-security/evals/triggers.json +16 -0
  63. package/skills/agent-security/references/host-configs.md +37 -0
  64. package/skills/api-client-integration/SKILL.md +86 -0
  65. package/skills/api-client-integration/evals/triggers.json +16 -0
  66. package/skills/api-client-integration/references/resilience.md +57 -0
  67. package/skills/blender-automation/SKILL.md +100 -0
  68. package/skills/blender-automation/evals/triggers.json +16 -0
  69. package/skills/blender-automation/references/batch-and-render.md +77 -0
  70. package/skills/blender-automation/references/bpy-inspection.md +91 -0
  71. package/skills/blender-automation/references/rig-and-retarget-checks.md +23 -0
  72. package/skills/brand-strategy/SKILL.md +83 -0
  73. package/skills/brand-strategy/evals/triggers.json +16 -0
  74. package/skills/change-impact-analysis/SKILL.md +89 -0
  75. package/skills/change-impact-analysis/evals/triggers.json +16 -0
  76. package/skills/change-impact-analysis/references/graph-commands.md +28 -0
  77. package/skills/contract-drafting/SKILL.md +96 -0
  78. package/skills/contract-drafting/evals/triggers.json +16 -0
  79. package/skills/contract-drafting/references/term-sheets.md +68 -0
  80. package/skills/contract-first-development/SKILL.md +86 -0
  81. package/skills/contract-first-development/evals/triggers.json +16 -0
  82. package/skills/contract-first-development/references/tooling.md +46 -0
  83. package/skills/decision-council/SKILL.md +98 -0
  84. package/skills/decision-council/evals/triggers.json +16 -0
  85. package/skills/design-brainstorming/SKILL.md +132 -0
  86. package/skills/design-brainstorming/evals/behavior.json +55 -0
  87. package/skills/design-brainstorming/evals/triggers.json +16 -0
  88. package/skills/design-brainstorming/references/visual-mockups.md +34 -0
  89. package/skills/desktop-app-testing/SKILL.md +104 -0
  90. package/skills/desktop-app-testing/evals/triggers.json +16 -0
  91. package/skills/desktop-app-testing/references/drivers.md +81 -0
  92. package/skills/document-processing/SKILL.md +100 -0
  93. package/skills/document-processing/evals/triggers.json +17 -0
  94. package/skills/document-processing/references/extraction-and-ocr.md +71 -0
  95. package/skills/document-processing/references/forms-and-conversion.md +69 -0
  96. package/skills/document-processing/references/redaction.md +61 -0
  97. package/skills/energy-procurement/SKILL.md +106 -0
  98. package/skills/energy-procurement/evals/triggers.json +16 -0
  99. package/skills/finishing-a-branch/SKILL.md +127 -0
  100. package/skills/finishing-a-branch/evals/behavior.json +49 -0
  101. package/skills/finishing-a-branch/evals/triggers.json +16 -0
  102. package/skills/freight-carrier-management/SKILL.md +107 -0
  103. package/skills/freight-carrier-management/evals/triggers.json +16 -0
  104. package/skills/git-worktrees/SKILL.md +130 -0
  105. package/skills/git-worktrees/evals/behavior.json +56 -0
  106. package/skills/git-worktrees/evals/triggers.json +16 -0
  107. package/skills/google-workspace-integration/SKILL.md +65 -0
  108. package/skills/google-workspace-integration/evals/triggers.json +17 -0
  109. package/skills/google-workspace-integration/references/api.md +121 -0
  110. package/skills/harmonyos-arkts/SKILL.md +117 -0
  111. package/skills/harmonyos-arkts/evals/triggers.json +16 -0
  112. package/skills/harmonyos-arkts/references/build-errors.md +42 -0
  113. package/skills/implementation-plans/SKILL.md +117 -0
  114. package/skills/implementation-plans/evals/behavior.json +54 -0
  115. package/skills/implementation-plans/evals/triggers.json +16 -0
  116. package/skills/ios-platform-features/SKILL.md +99 -0
  117. package/skills/ios-platform-features/evals/triggers.json +16 -0
  118. package/skills/ios-platform-features/references/foundation-models.md +90 -0
  119. package/skills/jvm-sql-mappers/SKILL.md +98 -0
  120. package/skills/jvm-sql-mappers/evals/triggers.json +16 -0
  121. package/skills/jvm-sql-mappers/references/examples.md +129 -0
  122. package/skills/mobile-accessibility/SKILL.md +94 -0
  123. package/skills/mobile-accessibility/evals/triggers.json +16 -0
  124. package/skills/network-design/SKILL.md +98 -0
  125. package/skills/network-design/evals/triggers.json +16 -0
  126. package/skills/observability/SKILL.md +125 -0
  127. package/skills/observability/evals/triggers.json +17 -0
  128. package/skills/observability/references/otel-setup.md +87 -0
  129. package/skills/observability/references/slo-alerts.md +70 -0
  130. package/skills/open-source-release/SKILL.md +107 -0
  131. package/skills/open-source-release/evals/triggers.json +15 -0
  132. package/skills/open-source-release/references/history-scrub.md +65 -0
  133. package/skills/patent-research/SKILL.md +94 -0
  134. package/skills/patent-research/evals/triggers.json +16 -0
  135. package/skills/patent-research/references/databases-and-queries.md +52 -0
  136. package/skills/prospect-research/SKILL.md +87 -0
  137. package/skills/prospect-research/evals/triggers.json +16 -0
  138. package/skills/python-app-distribution/SKILL.md +107 -0
  139. package/skills/python-app-distribution/evals/triggers.json +16 -0
  140. package/skills/python-app-distribution/references/pypi-trusted-publishing.md +55 -0
  141. package/skills/python-app-distribution/references/windows-macos-signing.md +70 -0
  142. package/skills/quality-nonconformance/SKILL.md +107 -0
  143. package/skills/quality-nonconformance/evals/triggers.json +16 -0
  144. package/skills/quality-nonconformance/references/8d-and-capa.md +46 -0
  145. package/skills/react-testing/SKILL.md +121 -0
  146. package/skills/react-testing/evals/triggers.json +18 -0
  147. package/skills/react-testing/references/msw.md +64 -0
  148. package/skills/react-testing/references/queries.md +41 -0
  149. package/skills/react-testing/references/setup.md +74 -0
  150. package/skills/recommender-systems/SKILL.md +119 -0
  151. package/skills/recommender-systems/evals/triggers.json +16 -0
  152. package/skills/recommender-systems/references/evaluation.md +39 -0
  153. package/skills/refactoring-safely/evals/behavior.json +57 -0
  154. package/skills/reproducible-dev-environments/SKILL.md +132 -0
  155. package/skills/reproducible-dev-environments/evals/triggers.json +16 -0
  156. package/skills/responding-to-code-review/SKILL.md +124 -0
  157. package/skills/responding-to-code-review/evals/behavior.json +54 -0
  158. package/skills/responding-to-code-review/evals/triggers.json +16 -0
  159. package/skills/security-review/evals/behavior.json +56 -0
  160. package/skills/session-handoff/evals/behavior.json +55 -0
  161. package/skills/skill-authoring/SKILL.md +13 -2
  162. package/skills/skill-authoring/evals/triggers.json +2 -1
  163. package/skills/skill-authoring/references/pressure-testing.md +87 -0
  164. package/skills/slide-decks/SKILL.md +107 -0
  165. package/skills/slide-decks/evals/triggers.json +18 -0
  166. package/skills/slide-decks/references/html-decks.md +86 -0
  167. package/skills/slide-decks/references/layouts.md +45 -0
  168. package/skills/slide-decks/references/pptx.md +87 -0
  169. package/skills/subagent-driven-development/SKILL.md +109 -0
  170. package/skills/subagent-driven-development/evals/behavior.json +53 -0
  171. package/skills/subagent-driven-development/evals/triggers.json +15 -0
  172. package/skills/subagent-driven-development/references/implementer-brief.md +60 -0
  173. package/skills/subagent-driven-development/references/reviewer-briefs.md +52 -0
  174. package/skills/systematic-debugging/SKILL.md +92 -0
  175. package/skills/systematic-debugging/evals/behavior.json +59 -0
  176. package/skills/systematic-debugging/evals/triggers.json +16 -0
  177. package/skills/systematic-debugging/references/condition-waiting.md +52 -0
  178. package/skills/systematic-debugging/references/root-cause-tracing.md +49 -0
  179. package/skills/systematic-debugging/references/test-pollution.md +46 -0
  180. package/skills/tdd-workflow/SKILL.md +3 -1
  181. package/skills/tdd-workflow/evals/behavior.json +55 -0
  182. package/skills/tdd-workflow/evals/triggers.json +2 -1
  183. package/skills/tdd-workflow/references/testing-anti-patterns.md +87 -0
  184. package/skills/transactional-email/SKILL.md +68 -0
  185. package/skills/transactional-email/evals/triggers.json +17 -0
  186. package/skills/transactional-email/references/providers.md +63 -0
  187. package/skills/ui-demo-recording/SKILL.md +93 -0
  188. package/skills/ui-demo-recording/evals/triggers.json +16 -0
  189. package/skills/ui-demo-recording/references/cursor-and-captions.md +48 -0
  190. package/skills/ui-demo-recording/references/playwright-recording.md +63 -0
  191. package/skills/ui-demo-recording/references/post-processing.md +57 -0
  192. package/skills/ui-design-polish/SKILL.md +113 -0
  193. package/skills/ui-design-polish/evals/triggers.json +18 -0
  194. package/skills/ui-design-polish/references/detail-checklist.md +45 -0
  195. package/skills/ui-design-polish/references/tokens.md +68 -0
  196. package/skills/ui-flow-audit/SKILL.md +112 -0
  197. package/skills/ui-flow-audit/evals/triggers.json +17 -0
  198. package/skills/ui-motion/SKILL.md +103 -0
  199. package/skills/ui-motion/evals/triggers.json +18 -0
  200. package/skills/ui-motion/references/patterns.md +138 -0
  201. package/skills/ui-motion/references/tokens.md +52 -0
  202. package/skills/unicode-text-processing/SKILL.md +103 -0
  203. package/skills/unicode-text-processing/evals/triggers.json +17 -0
  204. package/skills/unicode-text-processing/references/apis.md +89 -0
  205. package/skills/unicode-text-processing/references/script-notes.md +50 -0
  206. package/skills/verification-loop/evals/behavior.json +52 -0
  207. package/skills/video-editing/SKILL.md +111 -0
  208. package/skills/video-editing/evals/triggers.json +16 -0
  209. package/skills/video-editing/references/edl-and-logging.md +44 -0
  210. package/skills/video-editing/references/ffmpeg-edit-recipes.md +92 -0
  211. package/skills/video-editing/references/resolve-scripting.md +53 -0
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: network-design
3
+ description: Produces a vendor-neutral design for an enterprise campus or multi-site network before anything is configured, from requirements and an aggregatable IPv4 and IPv6 addressing plan through OSPF area layout, the BGP edge to ISPs, VLANs, VRFs and segmentation zones, first-hop redundancy and dual uplinks, WAN or SD-WAN topology, and a staged cutover plan with rollback points and validation tests. Use when planning a new office, data centre or branch network, redesigning a flat or outgrown network, merging two company networks, choosing between MPLS, internet VPN and SD-WAN, or writing the migration plan for a network change that must not cause an outage.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Produces design documents and plans; no device access needed. Device configuration belongs to the vendor or automation skills.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: devops
9
+ kete-loom/risk: read-only
10
+ kete-loom/owner: "Kete-org"
11
+ ---
12
+
13
+ # Network design
14
+
15
+ Turn requirements into a network design someone can build and migrate to safely. This skill decides what the network should be. Typing the config is for the Cisco IOS or network automation skills, diagnosing faults is for network troubleshooting or BGP diagnostics, and a home lab is for the homelab skill.
16
+
17
+ ## 0. Gather requirements (stop and ask for anything missing)
18
+
19
+ Write down, per site: users and devices now and in three years, critical applications and where they run (on site, data centre, cloud), required uptime, existing hardware and contracts, ISPs and circuits, compliance zones (card data, OT/industrial, guest), and the team's operational skills. Ask for the existing addressing and any overlapping ranges from partners or acquired companies.
20
+
21
+ Do not design until you know the growth figure, the uptime target and which systems must be isolated.
22
+
23
+ ## 1. Addressing plan
24
+
25
+ 1. Pick a private IPv4 supernet per organisation from RFC 1918 (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) and give each site one contiguous block so it summarises to a single route (for example `10.<site>.0.0/16`). Avoid `192.168.0.0/24` and `192.168.1.0/24` (home VPN clashes) and anything a partner or cloud VPC already uses.
26
+ 2. Inside a site, carve by function in fixed positions so every site looks alike: infrastructure (loopbacks `/32`, point-to-points `/31` per RFC 3021), management, users, voice, wireless, servers, IoT, guest.
27
+ 3. Size each subnet for the three-year count plus 30 to 50 percent; prefer `/24` for user VLANs for readability unless hosts exceed it.
28
+ 4. IPv6: get a provider-independent or provider-assigned prefix, give each site a `/48` (or `/56` for small sites), each VLAN a `/64`. Map the VLAN ID into the IPv6 subnet ID where it fits so addresses are readable.
29
+ 5. Reserve blocks for future sites and for NAT, VPN client pools and cloud.
30
+ 6. Record the plan as a table: site, function, VLAN ID, IPv4 prefix, IPv6 prefix, gateway, DHCP scope, zone.
31
+
32
+ ## 2. Routing design
33
+
34
+ - **Interior:** use OSPF (or IS-IS) with area 0 as the backbone. Put each site or region in its own area attached to area 0, and summarise at the area border routers. Use stub or totally stubby areas for branches with one way out. Keep area 0 small and contiguous.
35
+ - **Static routes** only for stub edges with no alternative path, and always with a tracked next hop or floating backup.
36
+ - **BGP edge:** needs your own public ASN and provider-independent (or ISP-assigned and portable) address space; without them, use each ISP's default route with tracked failover and NAT per ISP, and ask the user before planning an ASN or PI request. With them: eBGP to each ISP. Advertise only your own aggregates (inbound and outbound prefix lists, max-prefix limits), register ROAs for RPKI, use local preference to choose the primary exit and AS-path prepending or provider communities to steer inbound traffic. Take default routes, or full tables only if the routers have the memory and you need the path choice. Use iBGP between edge routers.
37
+ - **Cloud and partners:** BGP over IPsec or the provider's private interconnect; filter what each side may send.
38
+ - Make the failure behaviour explicit: for each link and device, write which path traffic takes when it fails and how long convergence takes (BFD where sub-second matters).
39
+
40
+ ## 3. Layer 2 and segmentation
41
+
42
+ 1. Use a collapsed core (core plus access) for one building, three tiers (core, distribution, access) for campuses. Route at the distribution or core; keep VLANs local to an access block, never stretched across the campus or between sites without a clear need (and then use EVPN/VXLAN, not spanning tree across a WAN).
43
+ 2. One VLAN per function per access block. Disable unused ports into a parking VLAN; never carry user traffic on VLAN 1; native VLAN unused.
44
+ 3. Spanning tree: rapid PVST+ or MST, root bridge pinned on the distribution pair, BPDU guard on edge ports.
45
+ 4. Segment by zone (users, servers, management, guest, IoT, card data, OT) with VRFs or firewall zones. Write the inter-zone policy as a matrix (source zone, destination zone, allowed services) with default deny.
46
+ 5. Management network out of band or in its own VRF; only jump hosts reach it.
47
+ 6. Port security with 802.1X/NAC where the organisation can operate it; otherwise MAC limits and DHCP snooping with dynamic ARP inspection.
48
+
49
+ ## 4. Redundancy
50
+
51
+ - Gateways: a first-hop redundancy protocol (VRRP per RFC 5798 is the open standard; HSRP or GLBP on Cisco) or an active-active design such as anycast gateways in EVPN, or multi-chassis link aggregation (vPC, MLAG, StackWise Virtual) with LACP uplinks.
52
+ - Every access switch dual-homed to two distribution switches; every distribution switch to two core switches.
53
+ - Two ISPs with different physical paths into the building, on two edge routers and two firewalls in an HA pair.
54
+ - Power: dual PSUs on separate feeds, UPS for core, edge and wireless controllers.
55
+ - Write down single points of failure that remain and why they are accepted.
56
+
57
+ ## 5. WAN and SD-WAN
58
+
59
+ | Option | Choose when |
60
+ |---|---|
61
+ | MPLS L3VPN | strict latency or SLA needs, carrier-managed QoS, budget allows |
62
+ | Internet with IPsec (hub and spoke or full mesh) | few sites, cost first, team can run VPNs |
63
+ | SD-WAN | many sites, mixed circuits (broadband, LTE/5G, MPLS), need application-aware path choice and central policy |
64
+
65
+ For SD-WAN: two transports per important site, central controller design and its failure mode, local internet breakout with security (SSE/firewall), QoS classes for voice and critical apps, and how SD-WAN routes are redistributed into OSPF/BGP without loops (tags, filters). Confirm vendor features and licensing with the vendor; do not assume them.
66
+
67
+ ## 6. Migration plan
68
+
69
+ Write a staged plan. Every stage has: scope, prerequisites, a maintenance window, exact steps, validation tests, a go/no-go decision, and a rollback that is tested and timed.
70
+
71
+ 1. Stage 0: document the current state (configs backed up, current routing tables and traffic baselines captured).
72
+ 2. Build the new core or edge in parallel where possible; connect it with a temporary routed link.
73
+ 3. Move one low-risk segment or pilot site first; run it for a defined soak period.
74
+ 4. Move remaining segments in batches, critical systems last, never all in one window.
75
+ 5. Decommission old paths only after the soak and after removing their routes.
76
+ 6. Rollback triggers: name them up front (for example, a critical app unreachable for 5 minutes, routing table size off by more than 10 percent).
77
+
78
+ Validation per stage: reachability between every zone pair the policy allows (and denial for the ones it blocks), gateway failover by shutting one device, ISP failover, DNS and DHCP from each VLAN, application tests by their owners.
79
+
80
+ ## Never
81
+
82
+ - Never reuse an address range that overlaps another site, partner or cloud network.
83
+ - Never advertise more than your own aggregates to an ISP or accept routes without filters.
84
+ - Never plan a cutover without a tested rollback and a named person who decides go or no-go.
85
+ - Never stretch Layer 2 between sites to avoid re-addressing without the user accepting the risk.
86
+
87
+ ## Report back
88
+
89
+ ```
90
+ Requirements and assumptions: <list, with what the user still has to confirm>
91
+ Addressing plan: <table>
92
+ Routing: <IGP areas, BGP edge, failure paths>
93
+ Segmentation: <zones, VRFs, policy matrix>
94
+ Redundancy: <per layer; remaining single points of failure>
95
+ WAN: <choice and why>
96
+ Migration: <stages with validation and rollback>
97
+ Risks and open questions: <list>
98
+ ```
@@ -0,0 +1,16 @@
1
+ {
2
+ "should_trigger": [
3
+ "Design the network for our new three-floor office and two branches: addressing, VLANs, routing and redundancy",
4
+ "We acquired a company whose 10.0.0.0/16 overlaps ours, plan how to merge the two networks",
5
+ "Should our 40 retail sites use MPLS, IPsec over broadband, or SD-WAN? Lay out the trade-offs",
6
+ "Write a staged migration plan with rollback for moving our flat /16 network to segmented VLANs and VRFs",
7
+ "Plan the OSPF area layout and the BGP edge to two ISPs for our campus and data centre"
8
+ ],
9
+ "should_not_trigger": [
10
+ "Our BGP session with the ISP keeps flapping between Active and Idle, why?",
11
+ "Give me the IOS commands to configure a trunk port on a Catalyst 9300",
12
+ "Write an Ansible playbook to push NTP config to 200 switches",
13
+ "Set up VLANs for IoT devices on my home lab with a Pi-hole",
14
+ "Users at the branch can't reach the file server, it times out"
15
+ ]
16
+ }
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: observability
3
+ description: OpenTelemetry-first service instrumentation that adds structured JSON logs carrying trace IDs, RED metrics with bounded-cardinality labels and distributed traces (SDK and exporter setup, semantic conventions, W3C traceparent propagation, head and tail sampling), then turns them into SLIs, SLOs, multi-window burn-rate alerts and on-call dashboards in Grafana, Prometheus or a vendor backend. Use when instrumenting a service with OpenTelemetry, traces break across service hops, logs cannot be joined to a request, defining an SLO or error budget, replacing noisy threshold alerts with burn-rate alerts, or building the operational board on-call opens first.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Works with any OpenTelemetry SDK (Java, Python, Go, Node, .NET and others) and any OTLP backend; examples use Prometheus query syntax and Grafana.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: devops
9
+ kete-loom/risk: writes-files
10
+ kete-loom/owner: "Kete-org"
11
+ ---
12
+
13
+ # Observability
14
+
15
+ Make every request answerable: which one failed, where it spent its time, and whether users are hurting enough to wake someone. Logs, metrics and traces share one resource identity and one trace ID, and alerts fire on user-facing SLO burn, not on CPU.
16
+
17
+ This skill is for operational telemetry. Business KPI boards belong to `metrics-dashboards`; what the on-call person does once paged belongs to `runbook-writing`.
18
+
19
+ ## 0. Before you start
20
+
21
+ 1. Find what is already there: search for `opentelemetry`, `prometheus`, `statsd`, `datadog`, `newrelic`, `logging.basicConfig`, `winston`, `zap`, `slog`, `logback`. Keep one telemetry stack; do not add a second SDK beside an existing one.
22
+ 2. Find the backend: an OpenTelemetry Collector, Grafana stack (Tempo, Loki, Mimir or Prometheus), or a vendor. If none exists and the user has not picked one, **stop and ask**; the backend decides exporters and query syntax.
23
+ 3. List the service's entry points (HTTP routes, queue consumers, cron jobs) and its outbound calls (databases, HTTP clients, queues). These are where spans and metrics go.
24
+
25
+ ## 1. Resource identity
26
+
27
+ Set these once, through environment variables so every signal shares them:
28
+
29
+ - `OTEL_SERVICE_NAME` (required; the same name in logs, metrics and traces)
30
+ - `OTEL_RESOURCE_ATTRIBUTES=service.version=<git sha or release>,deployment.environment.name=<env>`
31
+ - `OTEL_EXPORTER_OTLP_ENDPOINT` pointing at the Collector, not straight at a vendor, so sampling and routing can change without a redeploy.
32
+
33
+ Per-language SDK bootstrap and Collector config are in `references/otel-setup.md`.
34
+
35
+ ## 2. Traces
36
+
37
+ 1. Prefer the language's auto-instrumentation (HTTP server and client, database drivers, messaging) before writing manual spans.
38
+ 2. Add manual spans only around meaningful units of work the auto layer cannot see (a pricing calculation, a batch step). Name spans by operation, low cardinality: `GET /orders/{id}`, never `GET /orders/8812`.
39
+ 3. Use the semantic conventions for attributes (`http.request.method`, `http.route`, `http.response.status_code`, `db.system.name`, `server.address`); custom attributes get your own namespace (`app.order.tier`).
40
+ 4. Record errors: set span status to error and record the exception on the span that failed.
41
+ 5. Propagation: W3C `traceparent`/`tracestate` is the default. Check every hop: async queues need the context injected into message headers and extracted in the consumer; thread pools and background tasks need the context carried explicitly.
42
+ 6. Sampling:
43
+ - Start with `OTEL_TRACES_SAMPLER=parentbased_traceidratio` and `OTEL_TRACES_SAMPLER_ARG` (for example `0.1`) so children follow the root's decision.
44
+ - To keep all errors and slow requests, do tail sampling in the Collector (`tail_sampling` processor), and make sure all spans of a trace reach the same Collector instance.
45
+ - Never sample metrics. Rates come from metrics, not from sampled traces.
46
+
47
+ ## 3. Metrics
48
+
49
+ 1. Per entry point, emit RED: request rate, errors, duration as a histogram (`http.server.request.duration` in seconds from auto-instrumentation, or your own). Per dependency, the same on the client side. Per queue: depth and age of oldest message.
50
+ 2. Labels must be bounded. Never put user IDs, emails, raw URLs, order IDs or error messages in a label. Use the route template and the status code class.
51
+ 3. A latency SLI counts requests under the threshold, so the histogram needs a bucket boundary exactly at it. The default OpenTelemetry HTTP buckets are 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 s: pick an SLO threshold on one of them, or add the boundary with a metrics view (or use exponential histograms if the backend supports them).
52
+ 4. Add saturation for whatever runs out first: connection pool in use, worker queue, memory against limit.
53
+
54
+ ## 4. Logs
55
+
56
+ 1. Structured JSON, one event per line, to stdout. Fields: `timestamp`, `severity`, `message`, `service.name`, `trace_id`, `span_id`, plus event fields.
57
+ 2. Inject `trace_id`/`span_id` with the SDK's log bridge or logging instrumentation, so a log line links to its trace.
58
+ 3. Log events, not narration: one line per failed operation with its cause and inputs that are safe to log. Never log secrets, tokens, passwords, full card numbers or request bodies containing personal data; redact at the logger, not at query time.
59
+ 4. Default level INFO in production; DEBUG behind a runtime switch.
60
+
61
+ ## 5. SLIs and SLOs
62
+
63
+ 1. Pick 1 to 3 SLIs per user journey, each a ratio of good events to valid events:
64
+ - Availability: non-5xx responses / all responses (decide whether 429 and 4xx count; write it down).
65
+ - Latency: requests faster than the threshold / all requests, measured at the edge closest to the user you can instrument.
66
+ 2. Set the SLO target with the owner (for example 99.9% over 28 or 30 days). **Stop and ask** if no one owns the number; never invent a target.
67
+ 3. Error budget = 1 − target. Write the SLO as a file in the repo (definition, query, window, owner, what happens when the budget is spent).
68
+
69
+ ## 6. Burn-rate alerts
70
+
71
+ Page on how fast the budget burns, using a long and a short window together so alerts fire fast and reset fast. The standard pairs for a 30-day SLO (from the Google SRE Workbook):
72
+
73
+ | Severity | Long window | Short window | Burn rate | Budget spent at trigger |
74
+ |---|---|---|---|---|
75
+ | Page | 1h | 5m | 14.4 | 2% |
76
+ | Page | 6h | 30m | 6 | 5% |
77
+ | Ticket | 3d | 6h | 1 | 10% |
78
+
79
+ Query templates (Prometheus recording rules and alert rules) are in `references/slo-alerts.md`.
80
+
81
+ Alert rules:
82
+
83
+ - Every paging alert links to a runbook and a dashboard.
84
+ - Remove or demote cause-based alerts (CPU, memory, single pod restart) to tickets unless they predict an SLO breach no other alert catches.
85
+ - Low-traffic services: burn-rate alerts flap on few requests; add a minimum request count or use synthetic probes.
86
+
87
+ ## 7. On-call dashboard
88
+
89
+ One board per service, top to bottom:
90
+
91
+ 1. SLO status and remaining error budget, with the burn rate.
92
+ 2. RED for the entry points: rate, error ratio, p50/p95/p99 latency.
93
+ 3. Dependencies: the same RED, client side, per dependency.
94
+ 4. Saturation: pools, queues, memory and CPU against limits.
95
+ 5. Deploy and feature-flag annotations on every time series.
96
+ 6. Links: logs filtered to the service, trace search, runbook.
97
+
98
+ Use template variables for environment and instance; keep it under about 20 panels. Panel and query guidance is in `references/slo-alerts.md`.
99
+
100
+ ## 8. Verify
101
+
102
+ 1. Run the service locally or in a test environment with the Collector's `debug` exporter (or the backend) and send a request.
103
+ 2. Confirm: one trace spans every hop, including through a queue; the log line for that request carries the same `trace_id`; the RED metrics appear with only bounded labels.
104
+ 3. Evaluate each alert expression against recent data and check it would not have fired continuously.
105
+
106
+ ## Never
107
+
108
+ - Never put unbounded values in metric labels or span names.
109
+ - Never log secrets or personal data, or ship telemetry to a third party the user has not approved.
110
+ - Never page on a symptom with no user impact and no runbook.
111
+ - Never set an SLO target without an owner agreeing to it.
112
+
113
+ ## Report back
114
+
115
+ ```
116
+ ## Observability: <service>
117
+ Instrumented: <entry points, dependencies, signals>
118
+ Resource: service.name=<>, version source, environment
119
+ Sampling: <head ratio, tail policy>
120
+ SLOs: <SLI, target, window> per journey
121
+ Alerts: <name, windows, burn rate, runbook link>
122
+ Dashboard: <file or URL>
123
+ Verified: <trace across hops yes/no, logs joined yes/no, alert dry run>
124
+ Open questions: <owner, targets, backend>
125
+ ```
@@ -0,0 +1,17 @@
1
+ {
2
+ "should_trigger": [
3
+ "Add OpenTelemetry tracing to our Python and Go services and send it to a Collector",
4
+ "Our traces stop at the Kafka consumer, the span context isn't carried across the queue. Fix the propagation.",
5
+ "Define an availability SLO for the checkout API and write multi-window burn-rate alerts in Prometheus",
6
+ "Build the Grafana board on-call should open first when the payments service pages",
7
+ "Our log lines can't be matched to a request; add trace_id and span_id to the JSON logs",
8
+ "We get paged for CPU spikes nobody cares about, replace them with error budget alerts"
9
+ ],
10
+ "should_not_trigger": [
11
+ "Design a KPI dashboard for the sales team showing monthly recurring revenue and churn",
12
+ "Write a runbook for the HighErrorRate alert with diagnosis steps and escalation contacts",
13
+ "Write a blameless postmortem for yesterday's database outage",
14
+ "Plan a canary rollout with automatic rollback for the new pricing service",
15
+ "Set up a Helm chart and liveness probes for our API on Kubernetes"
16
+ ]
17
+ }
@@ -0,0 +1,87 @@
1
+ # OpenTelemetry setup
2
+
3
+ Read this when bootstrapping an SDK or a Collector. Package names and flags move between releases: check the language's page under opentelemetry.io/docs/languages/ for the current version before pinning.
4
+
5
+ ## Standard environment variables
6
+
7
+ | Variable | Example | Notes |
8
+ |---|---|---|
9
+ | `OTEL_SERVICE_NAME` | `checkout-api` | Same name in every signal |
10
+ | `OTEL_RESOURCE_ATTRIBUTES` | `service.version=4f2c1a9,deployment.environment.name=prod` | Comma-separated key=value |
11
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | `http://otel-collector:4318` | 4317 gRPC, 4318 HTTP |
12
+ | `OTEL_EXPORTER_OTLP_PROTOCOL` | `http/protobuf` | or `grpc` |
13
+ | `OTEL_TRACES_SAMPLER` | `parentbased_traceidratio` | |
14
+ | `OTEL_TRACES_SAMPLER_ARG` | `0.1` | Ratio for the root sampler |
15
+ | `OTEL_PROPAGATORS` | `tracecontext,baggage` | The default |
16
+
17
+ ## Auto-instrumentation by language
18
+
19
+ - **Java**: attach the agent, `java -javaagent:opentelemetry-javaagent.jar -jar app.jar`.
20
+ - **Python**: `pip install opentelemetry-distro opentelemetry-exporter-otlp`, then `opentelemetry-bootstrap -a install`, run with `opentelemetry-instrument python app.py`.
21
+ - **Node.js**: `npm install @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node`, start with `node --require @opentelemetry/auto-instrumentations-node/register app.js` (the SDK must load before the app's own imports).
22
+ - **.NET**: the `OpenTelemetry.Extensions.Hosting` package plus `OpenTelemetry.Instrumentation.AspNetCore` and `.Http`, registered with `services.AddOpenTelemetry().WithTracing(...).WithMetrics(...)`; or the zero-code automatic instrumentation.
23
+ - **Go**: no agent; wire `otelhttp` handlers and transports and the `otel/sdk` trace and metric providers in `main`, and call `Shutdown` on exit so the last spans flush.
24
+
25
+ Flush on shutdown in every language; short-lived jobs lose their spans otherwise.
26
+
27
+ ## Manual span (pattern)
28
+
29
+ ```python
30
+ from opentelemetry import trace
31
+ tracer = trace.get_tracer("app.pricing")
32
+
33
+ with tracer.start_as_current_span("price_quote") as span:
34
+ span.set_attribute("app.quote.items", len(items))
35
+ try:
36
+ quote = compute(items)
37
+ except Exception as exc:
38
+ span.record_exception(exc)
39
+ span.set_status(trace.Status(trace.StatusCode.ERROR))
40
+ raise
41
+ ```
42
+
43
+ ## Propagating through a queue
44
+
45
+ Producer: `propagate.inject(headers)` into the message headers. Consumer: `ctx = propagate.extract(headers)` and start the consumer span with that context (as a child, or as a new trace with a span link for batch consumers).
46
+
47
+ ## Minimal Collector config
48
+
49
+ ```yaml
50
+ receivers:
51
+ otlp:
52
+ protocols:
53
+ grpc:
54
+ endpoint: 0.0.0.0:4317
55
+ http:
56
+ endpoint: 0.0.0.0:4318
57
+ processors:
58
+ memory_limiter:
59
+ check_interval: 1s
60
+ limit_percentage: 80
61
+ batch: {}
62
+ tail_sampling:
63
+ decision_wait: 10s
64
+ policies:
65
+ - name: errors
66
+ type: status_code
67
+ status_code: { status_codes: [ERROR] }
68
+ - name: slow
69
+ type: latency
70
+ latency: { threshold_ms: 1000 }
71
+ - name: baseline
72
+ type: probabilistic
73
+ probabilistic: { sampling_percentage: 10 }
74
+ exporters:
75
+ debug: {}
76
+ otlp:
77
+ endpoint: tempo:4317
78
+ tls: { insecure: true } # only inside a private network
79
+ service:
80
+ pipelines:
81
+ traces:
82
+ receivers: [otlp]
83
+ processors: [memory_limiter, tail_sampling, batch]
84
+ exporters: [otlp]
85
+ ```
86
+
87
+ `tail_sampling` ships in the Collector contrib distribution, not core. With several Collector replicas, route by trace ID (the `loadbalancing` exporter) in a first tier so one instance sees the whole trace.
@@ -0,0 +1,70 @@
1
+ # SLO queries, burn-rate alerts and dashboard panels
2
+
3
+ Read this when writing recording rules, alert rules or dashboard queries. Metric names below assume OpenTelemetry HTTP server metrics exported to Prometheus (`http_server_request_duration_seconds_*`); rename to what the service actually exposes. When OTLP metrics reach Prometheus, `service.name` becomes the `job` label (`<service.namespace>/<service.name>` if a namespace is set) and `service.instance.id` becomes `instance`; resource attributes are not copied to labels unless the exporter is configured to (for example `resource_to_telemetry_conversion` or `target_info` joins). Check the real label names in the backend before writing rules.
4
+
5
+ ## Recording rules (availability SLI)
6
+
7
+ ```yaml
8
+ groups:
9
+ - name: slo-checkout
10
+ rules:
11
+ - record: slo:errors:ratio_rate5m
12
+ expr: |
13
+ sum(rate(http_server_request_duration_seconds_count{job="checkout-api",http_response_status_code=~"5.."}[5m]))
14
+ /
15
+ sum(rate(http_server_request_duration_seconds_count{job="checkout-api"}[5m]))
16
+ # repeat with [30m], [1h], [6h], [3d] and [30d] as slo:errors:ratio_rate30m, ... (the 30d one feeds the budget panel)
17
+ ```
18
+
19
+ Latency SLI (good = faster than 0.25 s; the `le` value must be an existing bucket boundary, an approximate one silently measures a different threshold):
20
+
21
+ ```
22
+ 1 - (
23
+ sum(rate(http_server_request_duration_seconds_bucket{job="checkout-api",le="0.25"}[5m]))
24
+ /
25
+ sum(rate(http_server_request_duration_seconds_count{job="checkout-api"}[5m]))
26
+ )
27
+ ```
28
+
29
+ ## Multi-window burn-rate alerts (SLO 99.9%, budget 0.001)
30
+
31
+ ```yaml
32
+ - alert: CheckoutErrorBudgetBurnFast
33
+ expr: |
34
+ slo:errors:ratio_rate1h > (14.4 * 0.001)
35
+ and
36
+ slo:errors:ratio_rate5m > (14.4 * 0.001)
37
+ labels: { severity: page }
38
+ annotations:
39
+ summary: "checkout-api burning error budget 14x"
40
+ runbook_url: "https://<runbooks>/checkout-api/error-budget"
41
+ dashboard: "https://<grafana>/d/checkout-api"
42
+ - alert: CheckoutErrorBudgetBurnMedium
43
+ expr: |
44
+ slo:errors:ratio_rate6h > (6 * 0.001)
45
+ and
46
+ slo:errors:ratio_rate30m > (6 * 0.001)
47
+ labels: { severity: page }
48
+ - alert: CheckoutErrorBudgetBurnSlow
49
+ expr: |
50
+ slo:errors:ratio_rate3d > (1 * 0.001)
51
+ and
52
+ slo:errors:ratio_rate6h > (1 * 0.001)
53
+ labels: { severity: ticket }
54
+ ```
55
+
56
+ Burn rate = observed error ratio / error budget. A burn rate of 1 spends exactly the budget over the SLO window. Tools such as Sloth or Pyrra generate these rules from a short SLO spec; use one if the team already does.
57
+
58
+ ## Dashboard panels (Grafana)
59
+
60
+ | Panel | Query sketch | Visual |
61
+ |---|---|---|
62
+ | Error budget remaining | `1 - (slo:errors:ratio_rate30d / 0.001)` | Stat, red under 25% |
63
+ | Burn rate 1h | `slo:errors:ratio_rate1h / 0.001` | Stat with thresholds 1, 6, 14.4 |
64
+ | Request rate | `sum by (http_route) (rate(..._count[5m]))` | Time series |
65
+ | Error ratio | `sum by (http_route) (rate(..._count{http_response_status_code=~"5.."}[5m])) / sum by (http_route) (rate(..._count[5m]))` | Time series |
66
+ | Latency p95/p99 | `histogram_quantile(0.99, sum by (le) (rate(..._bucket[5m])))` | Time series |
67
+ | Dependency latency | same on `http_client_request_duration_seconds` by `server_address` | Time series |
68
+ | Saturation | pool in use / pool max, queue depth | Time series with limit line |
69
+
70
+ Add annotations from the deploy pipeline (Grafana annotations API or a `deployments` metric), and data links from latency panels to the trace backend filtered by service and time range. Keep dashboards as JSON in the repo, provisioned from files, so changes are reviewed.
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: open-source-release
3
+ description: Takes a private or internal codebase public safely by scanning the working tree and full git history for secrets, personal data and internal hostnames with gitleaks and trufflehog, rewriting history with git filter-repo or starting a fresh history, choosing an outbound licence and checking third-party licence compatibility, adding README, CONTRIBUTING, SECURITY and CODE_OF_CONDUCT files and public CI, then walking a pre-publish checklist with explicit sign-off points. Use when someone wants to open-source an internal project, flip a private GitHub repository to public, or publish company code under an open licence for the first time.
4
+ license: MIT
5
+ compatibility: Any Agent Skills host. Needs git; secret scanning uses gitleaks or trufflehog, history rewriting uses git-filter-repo. Licence scanners depend on the ecosystem.
6
+ metadata:
7
+ kete-loom/version: "0.1.0"
8
+ kete-loom/category: devops
9
+ kete-loom/risk: runs-commands
10
+ kete-loom/requires: "git, gitleaks, git-filter-repo"
11
+ kete-loom/owner: "Kete-org"
12
+ ---
13
+
14
+ # Open-source release
15
+
16
+ Make a private repository safe to publish. Once a repository is public, anything in its history is copied by forks, mirrors and scrapers within minutes, so every check happens **before** the visibility flip, and none of it can be undone afterwards.
17
+
18
+ This skill is engineering preparation, not legal advice. The owner of the code (usually the employer) must approve the release and the licence; a lawyer or the company's open-source programme office should review licence and trademark questions.
19
+
20
+ ## 0. Stop and ask first
21
+
22
+ Before doing any work, confirm with the user:
23
+
24
+ 1. Who owns the code and has approved publishing it (name the person or the approval record).
25
+ 2. Whether contributors outside the company ever committed (their rights matter for relicensing).
26
+ 3. Whether to **keep history** (rewrite and scrub it) or **publish a fresh history** (one squashed initial commit). A fresh history is the safest default for internal code; keep history only if the user wants it and the scan in step 1 is clean or fully remediated.
27
+
28
+ Work in a **fresh clone** (`git clone --mirror` for scanning and rewriting history, a normal clone for the fresh-history route) so you never rewrite the team's working copy.
29
+
30
+ **Publish to a new public repository by default** rather than flipping the existing private one to public. Flipping visibility also exposes everything attached to the repository: issues, pull requests and their review comments, wiki, releases, Actions logs and artifacts, and `refs/pull/*` commits that a history rewrite cannot remove. Flip the existing repository only if the user explicitly wants that and has reviewed all of it.
31
+
32
+ ## 1. Scan for secrets, personal data and internal details
33
+
34
+ Scan the full history of every ref, not just the tip:
35
+
36
+ - `gitleaks git -v --log-opts="--all" --report-path gitleaks-history.json .`
37
+ - `gitleaks dir -v --report-path gitleaks-tree.json .` (working tree, including untracked files you plan to publish)
38
+ - `trufflehog git file://<path-to-clone> --results=verified,unknown` (run from outside the repo; it tries keys against providers, so tell the user it makes network calls)
39
+
40
+ Then search the codebase and history (`git log -p --all -S <term>` / `git grep`) for what scanners miss, including commit metadata (`git log --all --format='%an <%ae> %cn <%ce>' | sort -u` and commit messages), which can carry personal emails, ticket links and customer names:
41
+
42
+ - internal hostnames and domains (`*.internal`, `*.corp`, `*.local`, VPN and intranet names), private IP ranges, cloud account and project IDs, S3 bucket names;
43
+ - customer names, employee names and emails, phone numbers, real data in fixtures, seeds, test snapshots and screenshots;
44
+ - committed `.env`, `*.pem`, `*.p12`, `id_rsa`, kubeconfig, `terraform.tfstate`, database dumps, `.npmrc`/`.pypirc` with tokens;
45
+ - comments with security issues, incident details, unreleased product names, profanity about customers;
46
+ - vendored proprietary code, internal packages pulled from a private registry, licensed fonts or images.
47
+
48
+ Triage each hit as **live secret**, **dead secret**, **PII**, **internal detail** or **false positive**.
49
+
50
+ ## 2. Remediate
51
+
52
+ 1. **Rotate every real secret first**, live or "probably dead". Scrubbing history does not un-leak a key someone already copied. Record who rotated what.
53
+ 2. Remove PII and internal details from the current tree with normal commits.
54
+ 3. Then deal with history, following `references/history-scrub.md`:
55
+ - fresh history: copy the cleaned tree into a new repository with one initial commit;
56
+ - keep history: `git filter-repo --sensitive-data-removal --replace-text replacements.txt` and `--invert-paths --path <file>` for whole files; `--replace-message` for commit messages and `--mailmap` for author identities; then re-run every scan from step 1 until it is clean.
57
+ 4. Add the remaining false positives to a `.gitleaksignore` (fingerprints) so CI starts clean.
58
+
59
+ ## 3. Licence
60
+
61
+ 1. Ask the user which outbound licence the owner has chosen. If undecided, lay out the usual options without deciding for them: permissive (MIT, Apache-2.0 which adds an explicit patent grant, BSD-3-Clause), weak copyleft (MPL-2.0), strong copyleft (GPL-3.0, AGPL-3.0 for network services).
62
+ 2. Add the full licence text as `LICENSE` and an SPDX identifier in the package manifest (`"license": "Apache-2.0"`, `license = "MIT"`). Optional per-file `SPDX-License-Identifier` headers; `reuse lint` checks them if the project adopts REUSE.
63
+ 3. Inventory third-party licences with the ecosystem's tool (`references/history-scrub.md` lists them) and flag: no licence, unknown licence, copyleft dependencies incompatible with the chosen licence, and copied-in code whose origin is unclear. **Stop and ask** on any flag; a qualified person decides compatibility.
64
+ 4. If outside contributors will be accepted, ask whether the owner wants a DCO sign-off or a CLA. Don't pick one for them.
65
+
66
+ ## 4. Community and security files
67
+
68
+ Add or update, matching the project's real process (never promise response times nobody agreed to):
69
+
70
+ - `README.md`: what it is, status (experimental / stable), install, a working quick-start, how to run tests, licence.
71
+ - `CONTRIBUTING.md`: dev setup, test and lint commands, branch and PR rules, DCO/CLA if any.
72
+ - `SECURITY.md`: how to report a vulnerability privately (enable GitHub private vulnerability reporting, or a monitored address), supported versions. Ask the user for the contact.
73
+ - `CODE_OF_CONDUCT.md`: usually the Contributor Covenant (3.0 is current); fill in a real enforcement contact the user gives you.
74
+ - Issue and PR templates, `CODEOWNERS` if the team uses it.
75
+ - Remove internal-only files: deploy scripts for company infrastructure, internal runbooks, `.github/workflows` that use self-hosted runners or internal secrets.
76
+
77
+ ## 5. Public CI
78
+
79
+ - A workflow that builds, lints and tests on pull requests from forks, using no repository secrets on `pull_request` events.
80
+ - A secret scan on every push and PR (gitleaks action or `gitleaks git` in a job).
81
+ - Least-privilege `permissions:` on the token; for depth on workflow hardening use the `github-actions-ci` skill if installed.
82
+ - Enable secret scanning and push protection, Dependabot or equivalent, and branch protection on the default branch.
83
+
84
+ ## 6. Pre-publish checklist
85
+
86
+ Go through `references/history-scrub.md` "Final checklist" with the user. **Stop and ask for explicit sign-off** before:
87
+
88
+ - force-pushing rewritten history anywhere;
89
+ - creating the public repository or changing visibility to public;
90
+ - publishing to a package registry.
91
+
92
+ Never flip visibility yourself without that sign-off, and never publish while any scan finding is unresolved.
93
+
94
+ ## Report
95
+
96
+ ```
97
+ ## Open-source readiness: <repo>
98
+ Approval: <who approved, or MISSING>
99
+ History: fresh | rewritten (<tool>, first changed commit <sha>)
100
+ Secrets: <n found> / <n rotated> / <n remaining>
101
+ PII and internal details: <removed items, or none>
102
+ Licence: <SPDX id> | third-party flags: <list or none>
103
+ Files added: README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT, ...
104
+ CI: <workflow names> | secret scan in CI: yes/no
105
+ Blocking before publish: <list, or none>
106
+ Needs human sign-off: <owner approval, licence review, visibility flip>
107
+ ```
@@ -0,0 +1,15 @@
1
+ {
2
+ "should_trigger": [
3
+ "We want to open-source our internal CLI tool. What do we need to do before making the repo public?",
4
+ "Make sure there are no old API keys or internal hostnames anywhere in the git history before we flip this GitHub repo to public",
5
+ "Prepare this company project for its first public release under an open licence, with SECURITY.md and a code of conduct",
6
+ "Use git filter-repo to strip the customer data that was committed three years ago, then check we can publish the repo"
7
+ ],
8
+ "should_not_trigger": [
9
+ "Cut version 2.3.0 and write the release notes from the merged PRs",
10
+ "Scan the current change for vulnerabilities and leaked secrets before I push",
11
+ "Audit our npm dependencies for known CVEs and typosquatted packages",
12
+ "Rewrite the README so new users can get started faster",
13
+ "Squash my last five commits into one before I open the pull request"
14
+ ]
15
+ }
@@ -0,0 +1,65 @@
1
+ # History scrubbing, licence tools and final checklist
2
+
3
+ ## Fresh history (safest)
4
+
5
+ ```sh
6
+ git clone <private-url> work && cd work
7
+ # after cleaning the tree and committing:
8
+ rm -rf .git && git init -b main && git add -A
9
+ gitleaks dir -v . # must be clean before the first commit
10
+ git commit -m "Initial public release"
11
+ ```
12
+
13
+ Keep the private repository as the archive of old history.
14
+
15
+ ## Rewriting history with git filter-repo
16
+
17
+ Rotate secrets before you start. Work in a fresh clone.
18
+
19
+ `replacements.txt`, one expression per line (literal by default; `regex:` and `glob:` prefixes allowed; `==>` sets the replacement, otherwise matches become `***REMOVED***`):
20
+
21
+ ```
22
+ AKIAEXAMPLEKEY==>REDACTED
23
+ regex:[a-z0-9-]+\.corp\.example\.com==>internal.example
24
+ ```
25
+
26
+ ```sh
27
+ git filter-repo --sensitive-data-removal --replace-text ../replacements.txt
28
+ git filter-repo --sensitive-data-removal --invert-paths --path config/prod.env --path dumps/
29
+ git filter-repo --replace-message ../message-replacements.txt # same format, for commit messages
30
+ git filter-repo --mailmap ../mailmap # rewrite author/committer names and emails
31
+ ```
32
+
33
+ - `--sensitive-data-removal` fetches all refs first, reports the first changed commits and orphaned LFS objects, and prints cleanup steps for the remote and other clones.
34
+ - Keep `replacements.txt` outside the repository; it contains the secrets.
35
+ - Re-run `gitleaks git -v --log-opts="--all"` and the manual searches until clean.
36
+ - If the private remote must also be cleaned: `git push --force --mirror origin` only with the user's sign-off; hosts block some refs (`refs/pull/*`) and keep cached views, so follow the host's sensitive-data removal guide and contact its support to purge them. Every other clone must be re-cloned or cleaned.
37
+
38
+ ## Third-party licence inventory
39
+
40
+ | Ecosystem | Tool |
41
+ |---|---|
42
+ | npm / pnpm / Yarn | `npx license-checker-rseidelsohn --summary` (or the maintained checker the project uses) |
43
+ | Python | `pip-licenses --format=markdown` in the project's environment |
44
+ | Go | `go-licenses report ./...` |
45
+ | Rust | `cargo deny check licenses` with an allow-list in `deny.toml` |
46
+ | Java / Kotlin | Gradle or Maven licence plugins the build already uses |
47
+ | Any | `licensee detect` for the repository's own licence; `reuse lint` for REUSE compliance |
48
+
49
+ Also check for an SBOM requirement; `syft` or the ecosystem's SBOM tool can produce one.
50
+
51
+ ## Final checklist (all must be yes)
52
+
53
+ - [ ] Owner approval recorded
54
+ - [ ] Every found secret rotated, and scans of tree and full history are clean
55
+ - [ ] No PII, customer data, internal hostnames, IPs, account IDs or internal URLs remain
56
+ - [ ] `LICENSE` present, SPDX id in manifests, third-party licence flags resolved by a qualified person
57
+ - [ ] README quick-start works from a clean clone on a machine without internal network access
58
+ - [ ] Build and tests pass without private registries, internal services or company VPN
59
+ - [ ] CONTRIBUTING, SECURITY (with a real contact), CODE_OF_CONDUCT (with a real contact)
60
+ - [ ] Public CI green; secret scanning, push protection and branch protection enabled
61
+ - [ ] Internal-only workflows, runbooks and deploy config removed
62
+ - [ ] Trademarks and project name cleared by the owner
63
+ - [ ] Publishing to a new public repository, or, if flipping the existing one, issues, PRs, wiki, releases and Actions logs reviewed
64
+ - [ ] Commit authors, emails and messages reviewed (fresh history, or `--mailmap` / `--replace-message` applied)
65
+ - [ ] User gave explicit sign-off to change visibility