@greenrenge/skills 0.0.0-stage → 0.1.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 (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +63 -2
  3. package/bin/cli.mjs +349 -0
  4. package/catalog.json +201 -0
  5. package/package.json +49 -4
  6. package/skills/deck-story/SKILL.md +258 -0
  7. package/skills/deck-story/check-svg-text.mjs +94 -0
  8. package/skills/deck-story/check.mjs +348 -0
  9. package/skills/diagram-router/LICENSE +21 -0
  10. package/skills/diagram-router/SKILL.md +193 -0
  11. package/skills/diagram-router/THIRD_PARTY_NOTICES.md +15 -0
  12. package/skills/diagram-router/references/channels.md +213 -0
  13. package/skills/diagram-router/references/evals.md +85 -0
  14. package/skills/diagram-router/references/gathering.md +101 -0
  15. package/skills/diagram-router/references/prior-art.md +65 -0
  16. package/skills/diagram-router/references/routing.md +166 -0
  17. package/skills/diagram-router/skill-release.json +17 -0
  18. package/skills/frontend-design/SKILL.md +443 -0
  19. package/skills/frontend-design/references/rtl.md +72 -0
  20. package/skills/frontend-design/scripts/.upstream-sha +1 -0
  21. package/skills/frontend-design/scripts/LICENSE +21 -0
  22. package/skills/frontend-design/scripts/README.md +24 -0
  23. package/skills/frontend-design/scripts/gates.md +243 -0
  24. package/skills/frontend-design/scripts/sloplint-render.mjs +1283 -0
  25. package/skills/frontend-design/scripts/sloplint.mjs +4426 -0
  26. package/skills/open-code-review-rules/SKILL.md +59 -0
  27. package/skills/open-code-review-rules/references/ocr-allowlists.json +161 -0
  28. package/skills/open-code-review-rules/references/ocr-rule-semantics.md +39 -0
  29. package/skills/open-code-review-rules/scripts/verify_ocr_rules.py +836 -0
  30. package/skills/plain-english-mode/SKILL.md +41 -0
  31. package/skills/pr-diagram-portfolio/SKILL.md +75 -0
  32. package/skills/pr-diagram-portfolio/references/angle-framework.md +124 -0
  33. package/skills/pr-diagram-portfolio/references/portfolio-delivery.md +79 -0
  34. package/skills/pr-diagram-portfolio/scripts/restore_still_css.py +180 -0
  35. package/skills/pr-lens/LICENSE-upstream +21 -0
  36. package/skills/pr-lens/SKILL.md +99 -0
  37. package/skills/pr-lens/VENDOR.md +47 -0
  38. package/skills/pr-lens/package-lock.json +91 -0
  39. package/skills/pr-lens/package.json +9 -0
  40. package/skills/pr-lens/references/config.md +90 -0
  41. package/skills/pr-lens/references/example.graph.json +580 -0
  42. package/skills/pr-lens/references/graph-document.md +233 -0
  43. package/skills/pr-lens/skill-release.json +16 -0
  44. package/skills/security-remediation-epic/SKILL.md +316 -0
  45. package/skills/security-remediation-epic/prompt-template.md +33 -0
  46. package/skills/skill-maintainer/SKILL.md +99 -0
  47. package/skills/skill-maintainer/references/placement-and-coupling.md +43 -0
  48. package/skills/skill-maintainer/scripts/audit_skills.py +297 -0
  49. package/skills/t3-successor-handoff/SKILL.md +141 -0
  50. package/skills/t3-thread-bridge/SKILL.md +175 -0
  51. package/skills/t3-thread-bridge/references/launch-recipes.md +123 -0
  52. package/skills/t3-thread-bridge/references/ping-back.md +108 -0
  53. package/skills/t3-thread-bridge/scripts/thread_ledger.py +203 -0
  54. package/skills/t3-ticket-orchestrator/SKILL.md +304 -0
  55. package/skills/t3-ticket-orchestrator/references/proving-the-gates.md +63 -0
  56. package/skills/ulw-plan/SKILL.md +98 -0
  57. package/skills/ulw-plan/references/full-workflow.md +255 -0
  58. package/skills/ulw-plan/references/intent-clear.md +44 -0
  59. package/skills/ulw-plan/references/intent-unclear.md +44 -0
  60. package/skills/ulw-plan/scripts/plan-templates.mjs +180 -0
  61. package/skills/ulw-plan/scripts/scaffold-plan.mjs +187 -0
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: open-code-review-rules
3
+ description: >
4
+ Audit, author, and verify .opencodereview/rule.json for alibaba/open-code-review
5
+ (ocr). Use when writing or editing OCR review rules, verifying rule.json
6
+ coverage and reachability, or debugging why an ocr rule, include, or exclude
7
+ pattern is shadowed, dead, or skipped.
8
+ ---
9
+
10
+ # Open Code Review Rules
11
+
12
+ Verify and author `.opencodereview/rule.json` so every rule entry is reachable, every glob aligns with `ocr`'s file-selection gates, and the installed `ocr` CLI resolves the intended rules.
13
+
14
+ Read [`references/ocr-rule-semantics.md`](references/ocr-rule-semantics.md) before designing or refactoring rule entries.
15
+
16
+ ## Workflow
17
+
18
+ ### Step 1: Run the verification script
19
+
20
+ Run [`scripts/verify_ocr_rules.py`](scripts/verify_ocr_rules.py) from the repository or worktree root:
21
+
22
+ ```bash
23
+ python3 ~/.agents/skills/open-code-review-rules/scripts/verify_ocr_rules.py --repo .
24
+ ```
25
+
26
+ Useful flags:
27
+ - `--rule <path>` — audit a custom rule JSON file instead of `.opencodereview/rule.json`.
28
+ - `--commit <sha>` or `--from <ref> --to <ref>` — also run `ocr review --preview` on a real diff.
29
+ - `--strict` — fail with exit code 1 on warnings as well as errors.
30
+ - `--json` — emit machine-readable output.
31
+ - `--no-ocr` — run static checks only when `ocr` is not installed.
32
+
33
+ **Done when**: the script finishes and every `error` and `warning` in its report is accounted for.
34
+
35
+ ### Step 2: Diagnose findings against OCR semantics
36
+
37
+ Consult [`references/ocr-rule-semantics.md`](references/ocr-rule-semantics.md) for the exact rules behind each finding:
38
+
39
+ - **`unreachable_rule` / `partially_shadowed_rule`**: `rules[]` uses **first-match-wins** in declaration order; move specific paths above general ones and merge or remove duplicate patterns.
40
+ - **`catchall_does_not_stack`**: `merge_system_rule: true` merges only with `ocr`'s built-in language rule, never with other `rule.json` entries. Cross-cutting rules (secrets, governance, authoring) must be included in each matching entry (or kept in a single catch-all only for files not matched earlier).
41
+ - **`unsupported_ext_without_include` / `prose_targets_excluded_scope`**: `ocr review` drops unsupported extensions (such as `.md`) and `default_exclude_patterns` (tests, fixtures, lockfiles) before matching `rules[]`. Either add targeted `"include"` patterns or narrow the rule prose to files `ocr` actually selects.
42
+ - **`include_killed_by_exclude`**: `user_exclude` runs before `user_include`. Remove or narrow the conflicting `exclude` entry.
43
+ - **`glob_brace_syntax`**: OCR's `expandBraces` expands only the first `{...}` pair; rewrite nested or multi-group braces into flat patterns.
44
+ - **`zero_repo_matches` / `zero_eligible_matches`**: Confirm the glob matches real paths (`doublestar`, case-insensitive) and is not suppressed by `exclude` or `default_path`.
45
+ - **Over-broad directory prefixes**: Verify prefix globs (such as `apps/ml-*/**/*.py`) do not match unrelated sibling apps.
46
+
47
+ **Done when**: every finding has either a planned fix or an explicit, documented justification.
48
+
49
+ ### Step 3: Edit and re-verify
50
+
51
+ After updating `.opencodereview/rule.json`, re-run the verification script with `--strict` (or confirm any remaining warnings are intentional) and spot-check representative files with `ocr`:
52
+
53
+ ```bash
54
+ python3 ~/.agents/skills/open-code-review-rules/scripts/verify_ocr_rules.py --repo .
55
+ ocr rules check <representative-file-per-rule>
56
+ ocr review --preview [--from origin/main --to HEAD | --commit <sha>]
57
+ ```
58
+
59
+ **Done when**: `verify_ocr_rules.py` exits `0` with zero errors, `ocr delegate rule` / `ocr rules check` resolves the intended rule for every target path class, and `ocr review --preview` selects the expected files.
@@ -0,0 +1,161 @@
1
+ {
2
+ "_source": "alibaba/open-code-review internal/config/allowlist/{supported_file_types,default_exclude_patterns,default_secret_patterns}.json (verified against v1.14.6)",
3
+ "supported_file_types": [
4
+ ".java", ".kt", ".kts", ".scala", ".groovy",
5
+ ".py", ".pyi",
6
+ ".js", ".jsx", ".ts", ".tsx", ".mts", ".cts", ".mjs", ".cjs",
7
+ ".c", ".h", ".cpp", ".cc", ".cxx", ".hpp", ".hxx", ".cu", ".cuh", ".hip",
8
+ ".cs", ".vb", ".fs", ".fsi", ".fsx",
9
+ ".go", ".rs", ".rb", ".rake", ".gemspec", ".php", ".phtml", ".swift", ".m", ".mm",
10
+ ".sh", ".bash", ".zsh", ".fish", ".ps1", ".psm1", ".psd1",
11
+ ".sql", ".css", ".scss", ".sass", ".less", ".html", ".htm",
12
+ ".ftl", ".ftlh", ".ftlx", ".hbs", ".mustache", ".jinja2", ".j2", ".pug",
13
+ ".haml", ".slim", ".erb", ".astro", ".vue", ".ipynb", ".svelte",
14
+ ".xml", ".yaml", ".yml", ".json", ".toml", ".ini", ".env", ".gradle", ".cmake",
15
+ ".r", ".lua", ".pl", ".pm", ".ex", ".exs", ".erl", ".hrl", ".ets",
16
+ ".json5", ".jsonc", ".dart", ".tf", ".tofu", ".graphql", ".gql", ".prisma",
17
+ ".jl", ".hcl", ".tfvars", ".bicep", ".proto", ".nix", ".hs", ".lhs",
18
+ ".nim", ".nims", ".nimble", ".nu", ".elm", ".properties", ".po", ".pot",
19
+ ".jsonnet", ".libsonnet", ".zig", ".thrift", ".capnp", ".bzl", ".bazel", ".star",
20
+ ".ml", ".mli", ".re", ".rei", ".v", ".sv", ".vh", ".vhd", ".vhdl",
21
+ ".sol", ".vy", ".rego", ".glsl", ".hlsl", ".wgsl", ".metal",
22
+ ".ejs", ".liquid", ".njk", ".clj", ".cljs", ".cljc", ".edn", ".move", ".dhall"
23
+ ],
24
+ "default_exclude_patterns": [
25
+ "**/*_test.go",
26
+ "**/src/test/java/**/*.java",
27
+ "**/src/test/**/*.{kt,kts}",
28
+ "**/*Test.fs",
29
+ "**/*.test.{js,jsx,ts,tsx,mts,cts}",
30
+ "**/*.spec.{js,jsx,ts,tsx,mts,cts}",
31
+ "**/__tests__/**",
32
+ "**/test/**/*_test.py",
33
+ "**/tests/**/*_test.py",
34
+ "**/*_test.py",
35
+ "**/test_*.py",
36
+ "**/*_spec.rb",
37
+ "**/spec/**/*_spec.rb",
38
+ "**/*Test.java",
39
+ "**/*Tests.java",
40
+ "**/*_test.rs",
41
+ "**/*_tests.rs",
42
+ "**/tests.rs",
43
+ "**/tests/**/*.rs",
44
+ "**/benches/**/*.rs",
45
+ "**/*_{test,tests,unittest,benchmark}.{c,cc,cpp,cxx}",
46
+ "**/{test,tests,unittests}/**/*.{c,h,cc,cpp,cxx,hpp,hxx}",
47
+ "**/{bench,benchmarks}/**/*.{c,h,cc,cpp,cxx,hpp,hxx}",
48
+ "**/oh_modules/**",
49
+ "**/*.test.ets",
50
+ "**/test/**/*.jl",
51
+ "**/test/**/*.hs",
52
+ "**/*Spec.hs",
53
+ "**/test/**/*.lhs",
54
+ "**/*Spec.lhs",
55
+ "**/tests/**/*.nim",
56
+ "**/tests/**/*.nu",
57
+ "**/test/**/*.nu",
58
+ "**/*_test.nu",
59
+ "**/test_*.nu",
60
+ "**/test-*.nu",
61
+ "**/tests/**/*.R",
62
+ "**/test/**/*.{clj,cljs,cljc}",
63
+ "**/*_test.{clj,cljs,cljc}",
64
+ "**/resources/public/js/compiled/**/*.{js,cljs,cljc,edn}",
65
+ "**/.cpcache/**",
66
+ "**/.shadow-cljs/**",
67
+ "**/__snapshots__/**",
68
+ "**/*.snap",
69
+ "**/testdata/**",
70
+ "**/fixtures/**",
71
+ "**/.ipynb_checkpoints/**",
72
+ "**/*.generated.*",
73
+ "**/*.gen.go",
74
+ "**/*.pb.go",
75
+ "**/*.pb.cc",
76
+ "**/*.pb.h",
77
+ "**/*Test.swift",
78
+ "**/*Tests.swift",
79
+ "**/Tests/**/*.swift",
80
+ "**/tests/**/*.elm",
81
+ "**/test/**/*.zig",
82
+ "**/*_test.zig",
83
+ "**/kitex_gen/**/*.go",
84
+ "**/*.capnp.h",
85
+ "**/*.capnp.go",
86
+ "**/*.capnp.ts",
87
+ "**/*_capnp.rs",
88
+ "**/*_capnp.py",
89
+ "**/build/**/*.move",
90
+ "**/tests/**/*.move",
91
+ "**/*_test.move",
92
+ "**/*_tests.move",
93
+ "**/test/**/*.ml",
94
+ "**/tb_*.{v,sv,vhd,vhdl}",
95
+ "**/*_tb.{v,sv,vhd,vhdl}",
96
+ "lib/**/*.sol",
97
+ "**/*.t.sol",
98
+ "**/test/**/*.sol",
99
+ "**/tests/**/*.sol",
100
+ "**/test/**/*.vy",
101
+ "**/tests/**/*.vy",
102
+ "**/node_modules/**",
103
+ "**/bower_components/**",
104
+ "**/.pnpm-store/**",
105
+ "**/.yarn/{cache,unplugged,releases,sdks,patches}/**",
106
+ "**/.pnp.cjs",
107
+ "**/.pnp.loader.mjs",
108
+ "**/package-lock.json",
109
+ "**/pnpm-lock.yaml",
110
+ "**/npm-shrinkwrap.json",
111
+ "**/*.min.{js,css}",
112
+ "**/dist/**",
113
+ "**/.next/**",
114
+ "**/.nuxt/**",
115
+ "**/.svelte-kit/**",
116
+ "**/.astro/**",
117
+ "**/.turbo/**",
118
+ "**/.angular/**",
119
+ "**/.parcel-cache/**",
120
+ "**/.docusaurus/**",
121
+ "**/vendor/**",
122
+ "**/.bundle/**",
123
+ "**/target/**",
124
+ "**/.gradle/**",
125
+ "**/__pycache__/**",
126
+ "**/.venv/**",
127
+ "**/venv/**",
128
+ "**/site-packages/**",
129
+ "**/*.egg-info/**",
130
+ "**/.tox/**",
131
+ "**/.mypy_cache/**",
132
+ "**/.pytest_cache/**",
133
+ "**/.ruff_cache/**",
134
+ "**/Pods/**",
135
+ "**/Carthage/**",
136
+ "**/.build/**",
137
+ "**/obj/**",
138
+ "**/.dart_tool/**",
139
+ "**/.terraform/**",
140
+ "**/.terraform.lock.hcl",
141
+ "**/.stack-work/**",
142
+ "**/coverage/lcov-report/**"
143
+ ],
144
+ "default_secret_patterns": [
145
+ "**/.ssh/**",
146
+ "**/id_rsa",
147
+ "**/id_dsa",
148
+ "**/id_ecdsa",
149
+ "**/id_ed25519",
150
+ "**/.netrc",
151
+ "**/_netrc",
152
+ "**/.npmrc",
153
+ "**/.pypirc",
154
+ "**/.dockercfg"
155
+ ],
156
+ "secret_env_exceptions": [
157
+ ".env.example",
158
+ ".env.sample",
159
+ ".env.template"
160
+ ]
161
+ }
@@ -0,0 +1,39 @@
1
+ # OCR `rule.json` Semantics (`v1.14.6`)
2
+
3
+ Source behavior from `alibaba/open-code-review` (`internal/config/rules/system_rules.go` and `internal/agent/selection.go`).
4
+
5
+ ## 1. Resolution Layers & Worktree Anchoring
6
+
7
+ - Priority order: `--rule <path>` (CLI) → `<repoRoot>/.opencodereview/rule.json` → `~/.opencodereview/rule.json` → embedded `system_rules.json`.
8
+ - `repoRoot` is anchored at the Git top-level / worktree root. Subdirectory-local `rule.json` files are ignored.
9
+ - `FileFilter` (`include` / `exclude`) picks the **highest-priority layer** that defines any non-empty `include` or `exclude` (`buildFileFilter`); layers do not merge filters. CLI `--exclude` merges into that filter.
10
+
11
+ ## 2. Six-Gate File Selection (`ocr review` / `--preview`)
12
+
13
+ Before any rule text is resolved, each changed file passes six static gates in order:
14
+
15
+ 1. `binary` — binary diffs excluded.
16
+ 2. `secret_exclude` — built-in secret paths (`.ssh`, `.env` / `.env.*` except `.env.example`/`.sample`/`.template`, `.npmrc`, etc.) excluded; `include` cannot override this.
17
+ 3. `user_exclude` — `exclude` globs from `rule.json` + `--exclude`. Runs **before** `include`.
18
+ 4. `user_include` — `include` globs from `rule.json`. Any match is **kept immediately**, bypassing gates 5 and 6.
19
+ 5. `unsupported_ext` — files with an extension not in `supported_file_types` (e.g., `.md`, `.txt`, `.lock`) are excluded unless admitted by `include`. Extensionless files (`Dockerfile`, `Gemfile`, `.gitignore`) pass gate 5.
20
+ 6. `default_path` — built-in test/fixture/dependency/build globs (`default_exclude_patterns`) are excluded unless admitted by `include`. (`**/build/**` is deliberately absent from OCR's defaults.)
21
+
22
+ ## 3. First-Match-Wins Rule Resolution
23
+
24
+ - `rules[]` entries are evaluated **in declaration order** using `doublestar.Match` with case-insensitive matching (both path and pattern are lowercased).
25
+ - **Only the first matching entry applies.** Later entries matching the same path are skipped.
26
+ - `merge_system_rule` (boolean, default `false`):
27
+ - `false`: user rule replaces the built-in system rule.
28
+ - `true`: prepends `## System-Specific Rules (Mandatory)` (resolved per file by language/extension, e.g. `python.md`, `swift.md`, `default.md`) before `## User-Specific Rules (Mandatory)`.
29
+ - **`merge_system_rule: true` never merges two entries inside `rule.json`.**
30
+ - External file references: when `rule` is a single line with no spaces ending in `.md`, `.txt`, or `.markdown`, OCR reads that file relative to `repoRoot` (confined inside `repoRoot`, max 512 KiB). Otherwise `rule` is used inline.
31
+ - Note for repos using `ai-passport`'s PR bot fallback: when OCR errors, the bot may dump the raw `rule.json` into the prompt directly, so external `.md` references would not be expanded in that fallback.
32
+
33
+ ## 4. Glob & Brace Expansion Caveats
34
+
35
+ - `expandBraces` splits **only on the first `{` and first `}`**:
36
+ - `**/*.{ts,tsx,js,jsx}` works.
37
+ - Nested braces (`**/*.{ts,{js,jsx}}`) or multiple brace groups (`**/{a,b}/*.{ts,js}`) split wrongly and silently fail to match.
38
+ - `**/` matches zero or more directories (`**/project.json` matches both `project.json` and `apps/android/project.json`).
39
+ - `rules[].path` only selects prompt text for already-selected files; it never admits files excluded by gates 1–6.