Skip to content

Commit 5070171

Browse files
JoshJosh
authored andcommitted
Fix audit issues: security, hooks ordering, 404, favicon, sitemap
- Fix hooks: move useMemo above conditional return (Rules of Hooks) - Fix security: arrow functions in replace() to prevent $ injection, escape </script> in JSON-LD output - Fix 404.html: now auto-generated from built index.html at build time (was broken — referenced /src/main.jsx dev path) - Fix favicon: /favicon.svg -> /icskills/favicon.svg for GitHub Pages - Fix sitemap: remove cross-origin raw.githubusercontent.com URLs - Fix agent.json: add trailing slash to URL - Fix JSON-LD: add author (DFINITY Foundation) for Google rich results - Add llms-full.txt link alternate in index.html - Add CRLF handling to all frontmatter parsers - CODEOWNERS: add leading / to paths (idiomatic) - CSS: remove dead -webkit-overflow-scrolling, redundant word-wrap - Precompute framework color map with useMemo
1 parent 4f4e32b commit 5070171

10 files changed

Lines changed: 51 additions & 236 deletions

File tree

.github/CODEOWNERS

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
* @JoshDFN
66

77
# Skill files — domain experts
8-
skills/asset-canister/ @raymondk
9-
skills/certified-variables/ @raymondk
10-
skills/ckbtc/ @gregorydemay
11-
skills/evm-rpc/ @gregorydemay
12-
skills/icrc-ledger/ @gregorydemay
13-
skills/wallet/ @gregorydemay
14-
skills/internet-identity/ @aterga
15-
skills/sns-launch/ @bjoernek
16-
skills/https-outcalls/ @derlerd-dfinity
17-
skills/multi-canister/ @derlerd-dfinity
18-
skills/vetkd/ @andreacerulli
8+
/skills/asset-canister/ @raymondk
9+
/skills/certified-variables/ @raymondk
10+
/skills/ckbtc/ @gregorydemay
11+
/skills/evm-rpc/ @gregorydemay
12+
/skills/icrc-ledger/ @gregorydemay
13+
/skills/wallet/ @gregorydemay
14+
/skills/internet-identity/ @aterga
15+
/skills/sns-launch/ @bjoernek
16+
/skills/https-outcalls/ @derlerd-dfinity
17+
/skills/multi-canister/ @derlerd-dfinity
18+
/skills/vetkd/ @andreacerulli

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
<meta name="twitter:image" content="https://dfinity.github.io/icskills/og-image.svg">
2424

2525
<link rel="alternate" type="text/plain" title="LLMs.txt" href="/icskills/llms.txt">
26+
<link rel="alternate" type="text/plain" title="LLMs-Full.txt" href="/icskills/llms-full.txt">
2627

2728
<meta name="theme-color" content="#0a0a0f">
28-
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
29+
<link rel="icon" type="image/svg+xml" href="/icskills/favicon.svg">
2930

3031
<script type="application/ld+json">
3132
{
@@ -56,6 +57,7 @@
5657
"description": "Structured skill files for AI agents building on ICP. Covers ckBTC, ICRC ledger, Internet Identity, stable memory, HTTPS outcalls, EVM RPC, SNS, certified variables, VetKD, and more.",
5758
"url": "https://dfinity.github.io/icskills/",
5859
"isPartOf": { "@id": "https://dfinity.github.io/icskills/#website" },
60+
"author": { "@type": "Organization", "name": "DFINITY Foundation", "url": "https://dfinity.org" },
5961
"proficiencyLevel": "Expert"
6062
}
6163
]

public/404.html

Lines changed: 0 additions & 75 deletions
This file was deleted.

public/sitemap.xml

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -12,144 +12,72 @@
1212
<changefreq>monthly</changefreq>
1313
<priority>0.9</priority>
1414
</url>
15-
<url>
16-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/asset-canister/SKILL.md</loc>
17-
<lastmod>2026-02-25</lastmod>
18-
<changefreq>monthly</changefreq>
19-
<priority>0.7</priority>
20-
</url>
2115
<url>
2216
<loc>https://dfinity.github.io/icskills/skills/certified-variables/</loc>
2317
<lastmod>2026-02-25</lastmod>
2418
<changefreq>monthly</changefreq>
2519
<priority>0.9</priority>
2620
</url>
27-
<url>
28-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/certified-variables/SKILL.md</loc>
29-
<lastmod>2026-02-25</lastmod>
30-
<changefreq>monthly</changefreq>
31-
<priority>0.7</priority>
32-
</url>
3321
<url>
3422
<loc>https://dfinity.github.io/icskills/skills/ckbtc/</loc>
3523
<lastmod>2026-02-25</lastmod>
3624
<changefreq>monthly</changefreq>
3725
<priority>0.9</priority>
3826
</url>
39-
<url>
40-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/ckbtc/SKILL.md</loc>
41-
<lastmod>2026-02-25</lastmod>
42-
<changefreq>monthly</changefreq>
43-
<priority>0.7</priority>
44-
</url>
4527
<url>
4628
<loc>https://dfinity.github.io/icskills/skills/evm-rpc/</loc>
4729
<lastmod>2026-02-25</lastmod>
4830
<changefreq>monthly</changefreq>
4931
<priority>0.9</priority>
5032
</url>
51-
<url>
52-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/evm-rpc/SKILL.md</loc>
53-
<lastmod>2026-02-25</lastmod>
54-
<changefreq>monthly</changefreq>
55-
<priority>0.7</priority>
56-
</url>
5733
<url>
5834
<loc>https://dfinity.github.io/icskills/skills/https-outcalls/</loc>
5935
<lastmod>2026-02-25</lastmod>
6036
<changefreq>monthly</changefreq>
6137
<priority>0.9</priority>
6238
</url>
63-
<url>
64-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/https-outcalls/SKILL.md</loc>
65-
<lastmod>2026-02-25</lastmod>
66-
<changefreq>monthly</changefreq>
67-
<priority>0.7</priority>
68-
</url>
6939
<url>
7040
<loc>https://dfinity.github.io/icskills/skills/icrc-ledger/</loc>
7141
<lastmod>2026-02-25</lastmod>
7242
<changefreq>monthly</changefreq>
7343
<priority>0.9</priority>
7444
</url>
75-
<url>
76-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/icrc-ledger/SKILL.md</loc>
77-
<lastmod>2026-02-25</lastmod>
78-
<changefreq>monthly</changefreq>
79-
<priority>0.7</priority>
80-
</url>
8145
<url>
8246
<loc>https://dfinity.github.io/icskills/skills/internet-identity/</loc>
8347
<lastmod>2026-02-25</lastmod>
8448
<changefreq>monthly</changefreq>
8549
<priority>0.9</priority>
8650
</url>
87-
<url>
88-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/internet-identity/SKILL.md</loc>
89-
<lastmod>2026-02-25</lastmod>
90-
<changefreq>monthly</changefreq>
91-
<priority>0.7</priority>
92-
</url>
9351
<url>
9452
<loc>https://dfinity.github.io/icskills/skills/multi-canister/</loc>
9553
<lastmod>2026-02-25</lastmod>
9654
<changefreq>monthly</changefreq>
9755
<priority>0.9</priority>
9856
</url>
99-
<url>
100-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/multi-canister/SKILL.md</loc>
101-
<lastmod>2026-02-25</lastmod>
102-
<changefreq>monthly</changefreq>
103-
<priority>0.7</priority>
104-
</url>
10557
<url>
10658
<loc>https://dfinity.github.io/icskills/skills/sns-launch/</loc>
10759
<lastmod>2026-02-25</lastmod>
10860
<changefreq>monthly</changefreq>
10961
<priority>0.9</priority>
11062
</url>
111-
<url>
112-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/sns-launch/SKILL.md</loc>
113-
<lastmod>2026-02-25</lastmod>
114-
<changefreq>monthly</changefreq>
115-
<priority>0.7</priority>
116-
</url>
11763
<url>
11864
<loc>https://dfinity.github.io/icskills/skills/stable-memory/</loc>
11965
<lastmod>2026-02-25</lastmod>
12066
<changefreq>monthly</changefreq>
12167
<priority>0.9</priority>
12268
</url>
123-
<url>
124-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/stable-memory/SKILL.md</loc>
125-
<lastmod>2026-02-25</lastmod>
126-
<changefreq>monthly</changefreq>
127-
<priority>0.7</priority>
128-
</url>
12969
<url>
13070
<loc>https://dfinity.github.io/icskills/skills/vetkd/</loc>
13171
<lastmod>2026-02-25</lastmod>
13272
<changefreq>monthly</changefreq>
13373
<priority>0.9</priority>
13474
</url>
135-
<url>
136-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/vetkd/SKILL.md</loc>
137-
<lastmod>2026-02-25</lastmod>
138-
<changefreq>monthly</changefreq>
139-
<priority>0.7</priority>
140-
</url>
14175
<url>
14276
<loc>https://dfinity.github.io/icskills/skills/wallet/</loc>
14377
<lastmod>2026-02-25</lastmod>
14478
<changefreq>monthly</changefreq>
14579
<priority>0.9</priority>
14680
</url>
147-
<url>
148-
<loc>https://raw.githubusercontent.com/dfinity/icskills/main/skills/wallet/SKILL.md</loc>
149-
<lastmod>2026-02-25</lastmod>
150-
<changefreq>monthly</changefreq>
151-
<priority>0.7</priority>
152-
</url>
15381
<url>
15482
<loc>https://dfinity.github.io/icskills/llms.txt</loc>
15583
<lastmod>2026-02-25</lastmod>

scripts/generate-agent-json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const OUTPUT_DIR = join(ROOT, "public", ".well-known");
1313
const OUTPUT = join(OUTPUT_DIR, "agent.json");
1414

1515
function parseFrontmatter(content) {
16-
const match = content.match(/^---\n([\s\S]*?)\n---/);
16+
const match = content.replace(/\r\n/g, "\n").match(/^---\n([\s\S]*?)\n---/);
1717
if (!match) return null;
1818
const data = {};
1919
for (const line of match[1].split("\n")) {

scripts/generate-llms.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const OUTPUT = join(ROOT, "public", "llms.txt");
1313
const RAW = "https://raw.githubusercontent.com/dfinity/icskills/main";
1414

1515
function parseFrontmatter(content) {
16-
const match = content.match(/^---\n([\s\S]*?)\n---/);
16+
const match = content.replace(/\r\n/g, "\n").match(/^---\n([\s\S]*?)\n---/);
1717
if (!match) return null;
1818
const data = {};
1919
for (const line of match[1].split("\n")) {

scripts/generate-sitemap.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,7 @@ for (const dir of dirs) {
5353
<priority>0.9</priority>
5454
</url>
5555
`;
56-
// Raw SKILL.md URL (for agents)
57-
xml += ` <url>
58-
<loc>${RAW}/skills/${dir}/SKILL.md</loc>
59-
<lastmod>${lastmod}</lastmod>
60-
<changefreq>monthly</changefreq>
61-
<priority>0.7</priority>
62-
</url>
63-
`;
56+
// Note: raw.githubusercontent.com URLs omitted — sitemaps must be same-origin
6457
}
6558

6659
xml += ` <url>

0 commit comments

Comments
 (0)