feature-implementation
Implement a new feature in this Deno Fresh app the project's way — typed fixture → KV accessor + SEED_VERSION bump → server-rendered route/component → bilingual + sourced → deno task check. Use when b
SKILL.md.claude/skills/feature-implementation/SKILL.md
GitHubFeature implementation
The repeatable path for shipping a feature here, derived from how /economy /
the Status Paper were built. Pair with arch-discovery (where things live) and
data-discovery (sourcing the numbers).
The loop
- Model the data in
data/types.ts. Reuse existing types where possible (e.g.KpiTimePointfor any time-series). Mark optional*Mlfields. - Write the fixture in
data/<thing>.ts— a typed array. Every published figure carriessource+sourceUrlto an official government document (data-discoveryskill,docs/data/source-policy.md). - Wire the KV layer in
data/db.ts: add the["<thing>", id]prefix to the layout comment + theseed()wipe-list + the seed loop, addput*/list*/get*accessors, and bumpSEED_VERSION. - Project into the knowledge graph (only if the entity relates to existing
entities — a leaf with no relationships skips this). Add
<thing>Node+<thing>Edgesbuilders and async<Thing>Graphtolib/graph.ts, wire the prefix intobuildGraph(), and call the sync from yourputIngested*writer. Full recipe + the "silently dropped edge" gotcha:docs/specs/knowledge-graph.md. - Build the route/component under
routes/**/components/**. Server-render by default; add an island only for real client interactivity. Usedefine.handlers+define.page,t(lang, …)/pick, and the CSS tokens instatic/styles.css. For visuals, prefer SSR SVG / daisyUI over a chart library (seecomponents/MetricChart.tsx). - Bilingual. Provide verified
*Mlfor new strings. If you can't verify a Malayalam government term, leave it unset and setdataStatus: "tbd"— never guess. Run/bilingual-audit. - Nav. Add the entry to
components/Header.tsxif it's a top-level page. - Verify.
deno task check(fmt + lint + type-check) anddeno task check:sources. For data changes, run the relevant reviewer agent (kpi-data-reviewer/governance-data-reviewer). Smoke-test withdeno task devand, for visuals, a screenshot.
Gotchas
- The
deno fmtPostToolUse hook rewrites files on save — re-read before a second edit or the next edit'sold_stringwon't match. - Forgetting the
SEED_VERSIONbump = the site silently serves stale KV data. - A graph edge whose target node isn't projected yet is silently dropped (no
dangling edges by design) — seed/rehydrate nodes before
buildGraph()runs. Langis exported fromdata/lang.ts, notdata/types.ts.- JSX lists need a
keyprop (Fresh lint rulejsx-key).
Definition of done
deno task check + deno task check:sources green · SEED_VERSION bumped ·
bilingual parity (or tbd) · every figure government-sourced · a spec note in
docs/specs/ for non-trivial features.