@1aboveio/skills 0.20.2 → 0.20.4

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 (85) hide show
  1. package/README.md +14 -6
  2. package/package.json +1 -1
  3. package/runtime/skills/distribution/generated/recipes.json +220 -25
  4. package/runtime/skills/distribution/scripts/bundles.mjs +167 -48
  5. package/runtime/skills/engineering/engineering-runtime/scripts/workflow-coherence.mjs +4 -0
  6. package/runtime/skills/engineering/engineering-runtime/scripts/workflow-policy.mjs +1 -1
  7. package/skills/compliance/compliance-audit/LICENSE +3 -0
  8. package/skills/compliance/compliance-audit/SKILL.md +466 -0
  9. package/skills/compliance/compliance-audit/references/findings-schema.md +290 -0
  10. package/skills/compliance/compliance-audit/references/vars-checklist.md +1068 -0
  11. package/skills/compliance/compliance-audit/references/vars-findings-schema.md +395 -0
  12. package/skills/compliance/compliance-audit/scripts/reconcile_tracker.py +454 -0
  13. package/skills/compliance/compliance-audit/scripts/test_validate_tracker.py +90 -0
  14. package/skills/compliance/compliance-audit/scripts/validate_tracker.py +752 -0
  15. package/skills/compliance/doc-authenticity/LICENSE +3 -0
  16. package/skills/compliance/doc-authenticity/SKILL.md +158 -0
  17. package/skills/compliance/doc-authenticity/references/agreement.md +66 -0
  18. package/skills/compliance/doc-authenticity/references/bank-statement.md +150 -0
  19. package/skills/compliance/doc-authenticity/references/forensic-signals.md +157 -0
  20. package/skills/compliance/doc-authenticity/references/image-signals.md +114 -0
  21. package/skills/compliance/doc-authenticity/references/invoice.md +66 -0
  22. package/skills/compliance/doc-authenticity/references/issuer-profiles.md +86 -0
  23. package/skills/compliance/doc-authenticity/references/verdict-and-report.md +95 -0
  24. package/skills/compliance/doc-authenticity/references/verdict.schema.json +81 -0
  25. package/skills/compliance/doc-authenticity/scripts/image_forensics.py +294 -0
  26. package/skills/compliance/doc-authenticity/scripts/pdf_forensics.py +401 -0
  27. package/skills/compliance/doc-authenticity/scripts/validate_codes.py +224 -0
  28. package/skills/compliance/doc-authenticity/scripts/validate_verdict.py +308 -0
  29. package/skills/compliance/report-writing/LICENSE +3 -0
  30. package/skills/compliance/report-writing/SKILL.md +206 -0
  31. package/skills/compliance/report-writing/references/audit-report-template.md +121 -0
  32. package/skills/compliance/report-writing/references/external-assessment-template.md +167 -0
  33. package/skills/compliance/report-writing/references/management-report-template.md +145 -0
  34. package/skills/compliance/report-writing/references/vars-report-template.md +224 -0
  35. package/skills/document-utils/doc-to-md/LICENSE +3 -0
  36. package/skills/document-utils/doc-to-md/SKILL.md +77 -0
  37. package/skills/document-utils/doc-to-md/scripts/convert.py +157 -0
  38. package/skills/document-utils/reg-parser/LICENSE +3 -0
  39. package/skills/document-utils/reg-parser/SKILL.md +201 -0
  40. package/skills/document-utils/reg-parser/references/checklist-schema.md +223 -0
  41. package/skills/document-utils/reg-parser/references/checklists/hk-amlo-checklist.json +1306 -0
  42. package/skills/document-utils/reg-parser/references/checklists/hk-amlo-checklist.md +469 -0
  43. package/skills/document-utils/reg-parser/references/checklists/hk-fi-corporate-onboarding-cdd-checklist.json +634 -0
  44. package/skills/document-utils/reg-parser/references/checklists/hk-fi-corporate-onboarding-cdd-checklist.md +233 -0
  45. package/skills/document-utils/reg-parser/references/checklists/hk-mso-guideline-checklist.json +2194 -0
  46. package/skills/document-utils/reg-parser/references/checklists/hk-mso-guideline-checklist.md +771 -0
  47. package/skills/document-utils/reg-parser/references/checklists/kyc-aml-checklist.md +258 -0
  48. package/skills/document-utils/reg-parser/references/checklists/visa-vars-checklist.md +1058 -0
  49. package/skills/document-utils/reg-parser/references/mandates/hk-amlo-cap615.md +389 -0
  50. package/skills/document-utils/reg-parser/references/mandates/visa-vars.md +205 -0
  51. package/skills/document-utils/reg-parser/scripts/compare_checklist.py +228 -0
  52. package/skills/document-utils/reg-parser/scripts/dump_checklist.py +348 -0
  53. package/skills/document-utils/reg-parser/scripts/preprocess-mandate.sh +171 -0
  54. package/skills/document-utils/reg-parser/scripts/test_quarantine.sh +102 -0
  55. package/skills/document-utils/reg-parser/scripts/validate_checklist.py +532 -0
  56. package/skills/document-utils/reg-parser/scripts/validate_mandate.py +242 -0
  57. package/skills/engineering/engineering-runtime/coherence/workflow.json +16 -16
  58. package/skills/engineering/engineering-runtime/scripts/workflow-coherence.mjs +4 -0
  59. package/skills/engineering/engineering-runtime/scripts/workflow-policy.mjs +1 -1
  60. package/skills/payment/similar-domain/LICENSE +3 -0
  61. package/skills/payment/similar-domain/SKILL.md +178 -0
  62. package/skills/payment/similar-domain/references/entities.md +58 -0
  63. package/skills/payment/similar-domain/references/fingerprints.md +82 -0
  64. package/skills/payment/similar-domain/references/pivots.md +66 -0
  65. package/skills/payment/similar-domain/references/report-template.md +76 -0
  66. package/skills/payment/similar-domain/references/scoring.md +61 -0
  67. package/skills/payment/similar-domain/references/terminology.md +37 -0
  68. package/skills/payment/similar-domain/references/workflow.md +79 -0
  69. package/skills/payment/tld-detection/SKILL.md +76 -21
  70. package/skills/payment/tld-detection/references/clean.md +1 -1
  71. package/skills/payment/tld-detection/references/clustering.md +21 -6
  72. package/skills/payment/tld-detection/references/decision.md +7 -2
  73. package/skills/payment/tld-detection/references/fx-conversion.md +229 -0
  74. package/skills/payment/tld-detection/references/report-template.md +63 -27
  75. package/skills/payment/tld-detection/references/streams.md +90 -0
  76. package/skills/payment/tld-detection/references/terminology.md +15 -7
  77. package/skills/payment/tld-detection/references/workflow.md +1 -1
  78. package/skills/payment/tld-detection/scripts/detect_streams.py +542 -0
  79. package/skills/engineering/ensure-coverage/evals/evals.json +0 -125
  80. package/skills/engineering/rush-issues/evals/evals.json +0 -65
  81. package/skills/engineering/rush-release/evals/evals.json +0 -58
  82. package/skills/fullstack/shadcn/evals/evals.json +0 -90
  83. package/skills/payment/fraud-analysis/evals/evals.json +0 -40
  84. package/skills/payment/tld-detection/evals/evals.json +0 -107
  85. package/skills/payment/tld-detection/tests/test_detect_ladders.py +0 -132
@@ -0,0 +1,171 @@
1
+ #!/usr/bin/env bash
2
+ # preprocess-mandate.sh — Convert a mandate/regulatory document to structured Markdown
3
+ # Usage: bash preprocess-mandate.sh <input-file> [--source "Visa VARS"] [--out /path/to/output.md]
4
+ #
5
+ # Input: PDF, DOCX, HTML, TXT, or Markdown
6
+ # Output: Structured Markdown extract saved to references/mandates/<slug>.md
7
+ # (or custom path via --out)
8
+
9
+ set -euo pipefail
10
+
11
+ INPUT=""
12
+ SOURCE_NAME=""
13
+ OUTPUT=""
14
+
15
+ # Parse args
16
+ while [[ $# -gt 0 ]]; do
17
+ case "$1" in
18
+ --source) SOURCE_NAME="$2"; shift 2 ;;
19
+ --out) OUTPUT="$2"; shift 2 ;;
20
+ -*) echo "Unknown arg: $1" >&2; exit 1 ;;
21
+ *) INPUT="$1"; shift ;;
22
+ esac
23
+ done
24
+
25
+ if [ -z "$INPUT" ]; then
26
+ echo "Usage: $0 <input-file> [--source 'Source Name'] [--out output.md]" >&2
27
+ exit 1
28
+ fi
29
+
30
+ if [ ! -f "$INPUT" ]; then
31
+ echo "❌ File not found: $INPUT" >&2
32
+ exit 1
33
+ fi
34
+
35
+ # Derive source name from filename if not provided
36
+ if [ -z "$SOURCE_NAME" ]; then
37
+ BASENAME=$(basename "$INPUT")
38
+ SOURCE_NAME="${BASENAME%.*}"
39
+ echo "ℹ️ No --source provided, using filename: $SOURCE_NAME"
40
+ fi
41
+
42
+ # Derive slug for output filename
43
+ SLUG=$(echo "$SOURCE_NAME" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
44
+ DATE=$(date +%Y%m%d)
45
+
46
+ # Determine output path
47
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
48
+ MANDATES_DIR="$(dirname "$SCRIPT_DIR")/references/mandates"
49
+ mkdir -p "$MANDATES_DIR"
50
+
51
+ if [ -z "$OUTPUT" ]; then
52
+ # Check if a non-dated version already exists (known mandate)
53
+ if [ -f "$MANDATES_DIR/${SLUG}.md" ]; then
54
+ OUTPUT="$MANDATES_DIR/${SLUG}.md"
55
+ echo "ℹ️ Updating existing mandate: $OUTPUT"
56
+ else
57
+ # New ad-hoc mandate — use dated filename
58
+ OUTPUT="$MANDATES_DIR/adhoc-${SLUG}-${DATE}.md"
59
+ fi
60
+ fi
61
+
62
+ EXT="${INPUT##*.}"
63
+ EXT_LOWER=$(echo "$EXT" | tr '[:upper:]' '[:lower:]')
64
+
65
+ # Step 1: Convert to raw text
66
+ RAW_TMP=$(mktemp /tmp/mandate-raw-XXXXXX.txt)
67
+ trap "rm -f $RAW_TMP" EXIT
68
+
69
+ echo "📄 Converting $INPUT → raw text..."
70
+
71
+ case "$EXT_LOWER" in
72
+ pdf)
73
+ if command -v pdftotext &>/dev/null; then
74
+ pdftotext -layout "$INPUT" "$RAW_TMP"
75
+ elif command -v mutool &>/dev/null; then
76
+ mutool convert -F text -o "$RAW_TMP" "$INPUT"
77
+ elif python3 -c "import pdfminer" &>/dev/null 2>&1; then
78
+ python3 -c "
79
+ from pdfminer.high_level import extract_text
80
+ open('$RAW_TMP', 'w').write(extract_text('$INPUT'))
81
+ "
82
+ else
83
+ echo "❌ No PDF converter found. Install: sudo apt install poppler-utils" >&2
84
+ exit 1
85
+ fi
86
+ ;;
87
+ docx|doc)
88
+ if command -v pandoc &>/dev/null; then
89
+ pandoc "$INPUT" -t plain -o "$RAW_TMP"
90
+ elif python3 -c "import docx2txt" &>/dev/null 2>&1; then
91
+ python3 -c "import docx2txt; open('$RAW_TMP','w').write(docx2txt.process('$INPUT'))"
92
+ else
93
+ echo "❌ No DOCX converter. Install: sudo apt install pandoc" >&2
94
+ exit 1
95
+ fi
96
+ ;;
97
+ html|htm)
98
+ if command -v pandoc &>/dev/null; then
99
+ pandoc "$INPUT" -t plain -o "$RAW_TMP"
100
+ else
101
+ python3 -c "
102
+ from html.parser import HTMLParser
103
+ class P(HTMLParser):
104
+ def __init__(self): super().__init__(); self.t=[]
105
+ def handle_data(self,d): self.t.append(d)
106
+ p=P(); p.feed(open('$INPUT').read())
107
+ open('$RAW_TMP','w').write('\n'.join(p.t))
108
+ "
109
+ fi
110
+ ;;
111
+ txt|md)
112
+ cp "$INPUT" "$RAW_TMP"
113
+ ;;
114
+ *)
115
+ echo "❌ Unsupported format: .$EXT_LOWER (supported: pdf, docx, doc, html, txt, md)" >&2
116
+ exit 1
117
+ ;;
118
+ esac
119
+
120
+ CHARS=$(wc -c < "$RAW_TMP")
121
+ echo "✅ Converted: $CHARS chars"
122
+
123
+ # Step 2: Write structured header for agent to complete
124
+ # The agent reads the raw text and produces the structured extract.
125
+ # This script writes the raw text + extraction template so the agent has both.
126
+
127
+ cat > "$OUTPUT" << TEMPLATE
128
+ # ${SOURCE_NAME} — Contract Obligation Extract
129
+
130
+ > **Source file:** ${INPUT}
131
+ > **Preprocessed:** ${DATE}
132
+ > **Status:** RAW — agent extraction pending
133
+
134
+ ---
135
+
136
+ ## Raw Text (for agent extraction)
137
+
138
+ \`\`\`
139
+ $(cat "$RAW_TMP")
140
+ \`\`\`
141
+
142
+ ---
143
+
144
+ ## Extraction Template
145
+
146
+ <!-- Agent: replace this section with structured extract -->
147
+
148
+ ## Mandatory Downstream Agreement Clauses
149
+ <!-- Clauses the counterparty MUST include in downstream/merchant agreements -->
150
+ <!-- Format: **§[ref] [title]**: [obligation in one sentence] -->
151
+
152
+ ## Prohibited Conduct
153
+ <!-- Explicitly prohibited actions or business types -->
154
+ <!-- Format: **§[ref]**: [prohibition] -->
155
+
156
+ ## Thresholds & Triggers
157
+ <!-- Numeric thresholds, ratios, timelines that apply to downstream entities -->
158
+ <!-- Format: **§[ref] [metric]**: [value + consequence] -->
159
+
160
+ ## Audit & Oversight Rights
161
+ <!-- Rights granted to regulator/scheme to enforce compliance -->
162
+ <!-- Format: **§[ref]**: [right] -->
163
+
164
+ ## Notes
165
+ <!-- Jurisdiction scope, effective date, version, caveats -->
166
+ TEMPLATE
167
+
168
+ echo ""
169
+ echo "✅ Output: $OUTPUT"
170
+ echo " Next: agent reads this file and replaces the Extraction Template section"
171
+ echo " with structured content from the Raw Text."
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env bash
2
+ # test_quarantine.sh — Hide canonical reference checklists/mandates for a
3
+ # given source slug while a test run extracts the same source from scratch.
4
+ #
5
+ # Without this, an agent running reg-parser against tests/vars-source.pdf
6
+ # will discover references/checklists/visa-vars-checklist.md (listed in
7
+ # SKILL.md as a built-in reference) and short-circuit by copying it,
8
+ # defeating the test.
9
+ #
10
+ # Usage:
11
+ # bash test_quarantine.sh setup <source-slug>
12
+ # bash test_quarantine.sh teardown <source-slug>
13
+ # bash test_quarantine.sh status <source-slug>
14
+ #
15
+ # Example:
16
+ # bash test_quarantine.sh setup visa-vars
17
+ # # ... run agent against tests/vars-source.pdf ...
18
+ # bash test_quarantine.sh teardown visa-vars
19
+
20
+ set -euo pipefail
21
+
22
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
23
+ SKILL_DIR="$(dirname "$SCRIPT_DIR")"
24
+ QUARANTINE_DIR="/tmp/reg-parser-test-quarantine"
25
+
26
+ CMD="${1:-}"
27
+ SLUG="${2:-}"
28
+
29
+ if [ -z "$CMD" ] || [ -z "$SLUG" ]; then
30
+ echo "Usage: $0 setup|teardown|status <source-slug>" >&2
31
+ exit 2
32
+ fi
33
+
34
+ # Files that match a slug and should be hidden during the test.
35
+ # Both checklists and mandates: an agent might consult either.
36
+ TARGETS=(
37
+ "$SKILL_DIR/references/checklists/${SLUG}-checklist.md"
38
+ "$SKILL_DIR/references/mandates/${SLUG}.md"
39
+ )
40
+
41
+ mkdir -p "$QUARANTINE_DIR/$SLUG"
42
+
43
+ case "$CMD" in
44
+ setup)
45
+ moved=0
46
+ for t in "${TARGETS[@]}"; do
47
+ if [ -f "$t" ]; then
48
+ dest="$QUARANTINE_DIR/$SLUG/$(basename "$t")"
49
+ if [ -f "$dest" ]; then
50
+ echo "❌ Quarantine slot already taken: $dest" >&2
51
+ echo " A previous setup didn't tear down. Run teardown first." >&2
52
+ exit 1
53
+ fi
54
+ mv "$t" "$dest"
55
+ echo "🔒 Hidden: $t -> $dest"
56
+ moved=$((moved + 1))
57
+ fi
58
+ done
59
+ if [ "$moved" -eq 0 ]; then
60
+ echo "ℹ️ No files matched slug '$SLUG' — nothing to quarantine."
61
+ fi
62
+ ;;
63
+
64
+ teardown)
65
+ restored=0
66
+ for t in "${TARGETS[@]}"; do
67
+ src="$QUARANTINE_DIR/$SLUG/$(basename "$t")"
68
+ if [ -f "$src" ]; then
69
+ if [ -f "$t" ]; then
70
+ echo "⚠️ Original path already populated, leaving quarantine intact: $t" >&2
71
+ echo " (a fresh run wrote there; resolve manually)" >&2
72
+ continue
73
+ fi
74
+ mv "$src" "$t"
75
+ echo "🔓 Restored: $t"
76
+ restored=$((restored + 1))
77
+ fi
78
+ done
79
+ # Clean up empty slug dir
80
+ rmdir "$QUARANTINE_DIR/$SLUG" 2>/dev/null || true
81
+ if [ "$restored" -eq 0 ]; then
82
+ echo "ℹ️ Nothing in quarantine for slug '$SLUG'."
83
+ fi
84
+ ;;
85
+
86
+ status)
87
+ echo "Slug: $SLUG"
88
+ echo "Quarantine dir: $QUARANTINE_DIR/$SLUG"
89
+ for t in "${TARGETS[@]}"; do
90
+ src="$QUARANTINE_DIR/$SLUG/$(basename "$t")"
91
+ orig_present="no"; quar_present="no"
92
+ [ -f "$t" ] && orig_present="yes"
93
+ [ -f "$src" ] && quar_present="yes"
94
+ printf " %s orig=%s quarantined=%s\n" "$(basename "$t")" "$orig_present" "$quar_present"
95
+ done
96
+ ;;
97
+
98
+ *)
99
+ echo "Unknown command: $CMD (use setup|teardown|status)" >&2
100
+ exit 2
101
+ ;;
102
+ esac