Resources
20Install
npx skillscat add cschanhniem/cschanhniem-github-io Install via the SkillsCat registry.
Long-Form Manuscript Ingestion
This skill documents the house method for turning a long PDF manuscript into site-ready teaching content without losing structure, citations, appendix material, or release discipline.
When To Use It
Use this workflow when a source PDF is long, citation-heavy, or contains tables and diagrams that cannot survive plain OCR.
Canonical Paths
- Source PDF: repo root or task-specific import path.
- Extraction script:
nhapluu-app/scripts/ingest_scrnguna.py - English corpus:
nhapluu-app/src/content/teachings/<slug>/en/ - Vietnamese corpus:
nhapluu-app/src/content/teachings/<slug>/vi/ - Appendix assets:
nhapluu-app/public/teachings/<slug>/ - Site module:
nhapluu-app/src/data/teachings/<slug>/
Workflow
- Inspect the PDF structure first.
- Define section boundaries manually when the table of contents is reliable.
- Extract body text and footnotes separately.
- Repair OCR only where the errors are patterned and repeatable.
- Replace broken appendix OCR with image-backed markdown when layout matters.
- Draft or translate Vietnamese chapters carefully, chapter by chapter.
- Keep English chapters as the canonical fallback for unfinished Vietnamese sections.
- Build a small TypeScript bridge that imports chapter markdown into the site’s teaching model.
- Verify build output and inspect the public page.
- Publish the frontend by pushing
mainwhen the route is stable.
Short-Form Translation Release
Use this lighter branch when the source is a retreat handout, a short essay, or a single translated talk that does not need OCR repair or appendix preservation.
- Segment the piece into 3 to 6 markdown chapters if the source has natural shifts.
- Store the text under
src/content/teachings/<slug>/vi/. - Build a thin manifest bridge in
src/data/teachings/<slug>/index.ts. - Register metadata in
src/data/teachings/metadata.ts. - Add the slug to the lazy import map in
src/pages/TeachingDetail.tsx. - Write a release log in the repo-root
tasks/folder with source note and route target. - Run
npm run buildandnpm run lintbefore calling the route ready.
Route SEO Release Checks
Use this pass whenever a content release adds or changes a public route. The site now depends on a build-time SEO layer in addition to the client-side metadata hook.
- Confirm the route has a unique title, summary, and canonical path.
- Confirm the route family is represented in
scripts/build-seo-assets.mjs. - Run
npm run buildso the generator writes static HTML, sitemap, and robots artifacts. - Inspect at least one generated file under
dist/<route>/index.html. - Verify the route appears in the appropriate child sitemap referenced by
dist/sitemap.xmlif it is public. - Verify account or tool surfaces are excluded from the sitemap and carry
noindex,nofollow. - Keep the default social image crawler-safe. Use the shared
og-default.pngunless the route genuinely warrants a bespoke asset.
URL-Driven Library Branch Release
Use this pass when a library filter stops being local UI state and becomes a canonical branch route, as with Nikaya collection pages.
- Move the filter source of truth from component state to pathname parsing.
- Give each branch a stable collection URL and each detail page a canonical nested URL.
- Preserve old detail URLs with a redirect route and static fallback HTML when direct deep links may already exist.
- Pass
state.fromfrom listing to detail so back navigation lands on the right branch. - Update runtime metadata and build-time SEO enumeration together. Treat either half drifting out of sync as a release defect.
- Verify branch pages are indexable only when they are canonical. Legacy redirect surfaces should be
noindex.
Branch State Machine
stateDiagram-v2
[*] --> UnscopedLibrary
UnscopedLibrary --> BranchLibrary: pathname selects collection
BranchLibrary --> CanonicalDetail: click sutta card
CanonicalDetail --> BranchLibrary: state.from or inferred branch
LegacyDetail --> Redirected
Redirected --> CanonicalDetail
CanonicalDetail --> Redirected: slug mismatchBranch Sequence
sequenceDiagram
participant User
participant Library
participant Router
participant Detail
participant BuildSEO
User->>Library: choose collection branch
Library->>Router: navigate to /library/<branch>
User->>Library: choose sutta
Library->>Router: navigate to /library/<branch>/<id> with state.from
Router->>Detail: render canonical detail
User->>Router: open old detail link
Router->>Detail: redirect to canonical nested path
BuildSEO->>Router: generate branch + legacy fallback HTMLBranch Data Flow
flowchart LR
A[Sidebar filter intent] --> B[Branch pathname]
B --> C[Collection parser]
C --> D[Filtered listing]
D --> E[Detail pathname with branch]
E --> F[Canonical metadata]
F --> G[Static route generation]
H[Legacy detail path] --> I[Redirect resolver]
I --> ESEO State Machine
stateDiagram-v2
[*] --> MetadataReady
MetadataReady --> RouteEnumerated
RouteEnumerated --> StaticHtmlBuilt
StaticHtmlBuilt --> SitemapCovered
SitemapCovered --> Verified
Verified --> ReleaseLogged
ReleaseLogged --> ReadyToPublish
StaticHtmlBuilt --> RouteEnumerated: missing namespace
SitemapCovered --> MetadataReady: canonical or robots defectSEO Sequence
sequenceDiagram
participant Content
participant Metadata
participant BuildScript
participant Dist
participant Verifier
Content->>Metadata: route title and summary
Metadata->>BuildScript: route becomes enumerable
BuildScript->>Dist: write static route HTML
BuildScript->>Dist: write sitemap and robots
Verifier->>Dist: inspect generated route file
Verifier->>Dist: inspect sitemap inclusion or exclusionSEO Data Flow
flowchart LR
A[Teaching or route metadata] --> B[scripts/build-seo-assets.mjs]
B --> C[dist/route/index.html]
B --> D[dist/sitemap.xml]
B --> E[dist/robots.txt]
C --> F[Search crawler]
D --> F
E --> FNikaya Sutta Data QA
Use this branch when Nikaya detail pages show placeholder prose, raw Bilara templates, or version options that claim to exist without readable content.
- Inspect one affected local file under
public/data/suttacentral-json/<collection>/. - Distinguish file presence from readable content.
available.jsonis not enough for UI truth. - If the English payload comes from Bilara, inspect
html_text,translation_text,root_text, andkeys_order. - Compose Bilara
html_texttemplates withtranslation_textbefore rendering. Do not render raw{}placeholders. - Publish raw file readability into
content-availability.json, product-facing route readability intoeffective-content-availability.json, and child-to-canonical fallback routing intocanonical-aliases.json. - Keep the Nikaya selector limited to the curated 3-option set:
Tiếng Việt - Thích Minh Châu,Tiếng Anh - Bhikkhu Sujato, andTiếng Việt - Nhập Lưu 2026. - Within that curated set, keep disabled any option that lacks local readable content.
- Audit collection triad readiness with
npm run audit:nikaya -- <dn|mn|sn|an|kn>. - If the collection is
SNor another peyyala-heavy branch, inspectnikaya_index.jsonfor grouped range IDs such assn12.72-81and fetch those exact IDs too. - Treat Bilara
200 {"msg":"Not Found"}responses as missing English, not success. - For
KN, remember that collection inference must mapkp,dhp,ud,iti, andsnpinto theknfolder, and that this check must happen before any genericsnprefix logic. - Verify one collection route and one detail route in a browser after the patch.
- For
manual 2026authoring, store the copy insrc/data/nikaya-improved/vi/*.tsas curated markdown, keep the doctrinal structure intact, and use modern Vietnamese that still sounds disciplined when read aloud. - A
manual 2026file is only complete when it contains the full translation body of the route itself. Short commentary shells or note-style outlines are drafts, not final deliverables. - Do not use
Mũi kinh,Điều bài kinh muốn chỉ ra,Bài học thực hànhas the main architecture of the final translation. At most, keep one short framing note before or after a full translated body. - For peyyāla and grouped shorthand routes, expand the body into a route-complete translation. Do not hide missing expansion behind a compact paraphrase.
- For early
ANchild routes inside groupedTTCblocks, do not reuse the parent block title for every child. Name exact routes likean1.1andan1.10from their own segment content, or the manual layer will look structurally wrong even if the grouped fallback still renders. AN 1.11-20adds one more constraint for those early grouped blocks: the child routes come in mirrored pairs. Writean1.11-15as the causes that let hindrances arise andan1.16-20as the remedies that prevent or abandon them, so the reader can feel the symmetry built into the source.AN 1.21-30should be handled as a mind-training cluster. Keep the prose aware of the full sequence, unworkable and workable, harmful and beneficial, suffering and happiness, and do not lose the English nuance of unrealized and realized potential inan1.25-26.AN 1.71-81must be treated as a shaped editorial unit.an1.71-75form a conditions-of-training cluster, good friends, what one pursues, and wise or unwise attention.an1.76-81then split into two interlaced triads about loss and growth, where relatives, wealth, and fame are all subordinated to the single higher metric of wisdom. Do not flatten these into generic motivational sayings.AN 1.82-97is another high-structure block. Its eight pairs all repeat known themes, but the editorial center of gravity is the stronger verdictvery harmfulversusvery beneficial. Write the manual layer so that readers can feel this escalation, and restore full route-level clarity where the Minh Châu source uses peyyala shorthand likenhư số 1/2, chỉ thế vào ....AN 1.98-139is a three-stage editorial unit. First comes the interior-versus-exterior framing, then the same factors are re-read as causes for the true teaching to fade or endure, and finally the block turns into a doctrinal-integrity warning about mislabeling dhamma, vinaya, the Tathāgata's speech, practice, and prescriptions. The last ten routes must sound like safeguards of transmission, not like generic self-help advice.AN 1.140-149is the restoration mirror of the previous integrity block. The prose must feel affirmative but still exacting: calling not-dhamma not-dhamma, dhamma dhamma, and so on is not bland correctness, it is a communal act of merit that protects transmission. Keep the five integrity domains sharply separated so the reader can hear what exactly is being preserved.AN 1.31-40should read like a ladder of discipline around the same mind: untamed and tamed, unguarded and guarded, unprotected and protected, unrestrained and restrained. Letan1.39-40gather the whole ladder back together so the block closes with structural force.AN 1.41-50needs a different editorial rhythm. Keep the sequence as an arc from direction to destiny, then from clarity to pliancy, then into the luminous-mind pair.an1.49-50especially should stay sparse and exact; clarify the practical point, but do not load those two short suttas with extra doctrine that the source itself does not say.AN 1.51-60is another mixed block that still needs one spine. Read it as a sequence from seeing the luminous mind rightly, to the dignity of even a finger-snap of mettā, to intention as the lead factor, then heedfulness and laziness. Keepan1.53-55distinct at the level of verbs, arise, develop, direct, even though the formula is nearly identical.- Before trusting Nikaya totals, run
npm run audit:nikaya-integrity. It checks index parity, manifest parity, ordering defects, misplaced files, and alias IDs wheresuttaplex.uid !== file id. - Run
npm run audit:nikaya-originalswhen you need the stronger truth set for English plus Minh Châu: file presence, readable body text, alias UID drift, alias-target validity, alias-range validity, grouped-range completeness, title parity, Pali-title parity, canonicalprevious/nextcontinuity, and whether a readable Vietnamese source is genuinely Minh Châu. - In
KN, do not trust the*_vi_minh_chau.jsonsuffix by itself. A large metadata-only subset actually points tophantuananhor to no Vietnamese source metadata at all. - When regenerating
nikaya_index.json, sort IDs with token-aware numeric ordering and keep one row per local file id. Do not let groupedsuttaplex.uidswallow a real single route such asan1.100orsn12.100. - Preserve canonical punctuation in route IDs.
sn12.72must staysn12.72; do not normalize it intosn1272just to share a lookup helper with compact manual-translation keys. KNgrouped Dhammapada canonicals such asdhp1-20are now part of the local index. If English appears missing on a childdhp*route, checkcanonical-aliases.jsonand verify the grouped canonical file was fetched.- Treat route topology as its own truth set.
SNandANcurrently include both grouped range routes and all child alias routes, which is semantic duplication but not missing content.KNnow also has grouped canonicals, so itsdhp*children should inherit English via canonical fallback instead of looking missing. - Keep
alias range violationsandrange completeness violationsat0. A grouped canonical is not healthy if it exists in the index but silently drops child IDs or absorbs unexpected ones. - Use
effective-content-availability.jsonfor UI-facing totals andcontent-availability.jsonfor raw file-level audits. Do not mix them up. - Run
npm run audit:nikaya-coveragewhen the user asks the practical question, “bài nào thật sự đọc được bằng English và Minh Châu?” This matrix works at the canonical-block level and separates fallback-only aliases from genuinely missing English, genuinely missing Vietnamese, and missing canonical routes. - Run
npm run audit:nikaya-masterwhen you need the full executive summary in one place. It merges the raw file audit and the canonical coverage matrix so you can answer “đúng thứ tự chưa, thiếu gì, thừa gì, sai gì” without manually reconciling multiple reports. - On alias detail routes, do not trust remote
suttaplexmetadata to be complete. Merge it with local fallback metadata derived fromnikaya_index.json, and prefer the child row over any grouped canonical row for acronym, titles, and blurb. - In the public Nikaya library, hide grouped canonical fallback rows such as
sn12.72-81ordhp1-20. Keep them in the raw index for fallback resolution and audits, but do not expose them beside child routes in the main reader-facing list. - Apply that same grouping rule to SEO. Grouped canonical fallback rows should remain directly openable, but they should be omitted from indexable sitemaps and carry
noindex,nofollowin both static HTML and runtime page metadata. - When regenerating
nikaya_index.json, reject blank titles as real metadata. Ifsuttaplex.translated_titleortranslation.titleis empty, keep falling through to English and then to the Bilarasutta-titlesegment. - In that Bilara fallback, derive the visible title from
translation_textand only useroot_textas a Pali-title fallback when it is not just~. - When a triad audit reads
src/data/nikaya-improved/vi/*.ts, normalize filenames likesn-56-11.tsback tosn56.11. Do not flatten dotted IDs away, or manual 2026 coverage will be undercounted. - Token-sort Bilara segment keys in both local and remote fallbacks. Any helper that uses
parseFloat('1.10')on segment suffixes will scramble discourse order when the route falls back to the live API. - Run
npm run audit:nikaya-remotewhen you need proof from the official source. It now reports bothcanonicalgaps andvisible-routegaps, so cases likean1.330-332do not disappear behind a readable canonical block. If the result isnetwork error, rerun with real network access before concluding that the upstream source is silent. - If remote audit says the source is readable upstream but the local layer is still missing, run
node scripts/fetch-all-nikayas.mjs repair <collection> <en|vi>. That mode refetches only unreadable curated originals and skips child aliases already covered by canonical fallback. - After the current repair pass,
KNshould be treated as English-complete on the public reader surface. Do not keep describingKNas English-deficient unless a later audit shows regression. - Run
npm run audit:nikaya-fidelitywhen the user asks whether a visible route is exact, sliced from a grouped source, still showing the whole grouped block, or genuinely missing. - For grouped Bilara English, try two scoping passes before giving up: direct child-prefixed keys such as
an1.2:*, then range-position sections such assn12.72-81:1.1. The second pass rescues manySN,AN, andKNchild routes. - For grouped Minh Châu HTML, try the same narrowing discipline in a different shape: exact child
id, then nested subrangeid, thenTTCanchors such asTTC 3-5orTTC 14-17. TheseTTCslices are scoped grouped renders, not exact single-sutta renders, and they are only safe when the discoveredTTCranges cover the full grouped source contiguously from1..N. - In any Bilara or legacy payload audit, never count metadata keys like
uid,lang,title,author,previous, ornextas segment content. Only:keys are real segments, with a rare explicittextfield as the only direct-text exception. - If a route can only render an original layer as a whole grouped block, surface that fact in the reader. Do not silently present grouped fallback prose as if it were a clean single-sutta extraction.
- If a gap survives source inspection, register it in
src/lib/nikaya-source-gaps.tsand surface a verified source-gap notice inNikayaDetail. Use this for real absences such assn36.30,AN 11.*, or Englishan1.330-332. - Do not fabricate HT. Thích Minh Châu content for peyyala routes that do not exist in the verified edition. Once proven absent, the correct product behavior is an explicit source-gap explanation, not synthetic filler.
- For
SNmanual 2026 translation work, start with a doctrinal spine across major saṃyuttas instead of only translating consecutive IDs. A first pass that covers dependent origination, right view, not-self, the burning discourse, satipaṭṭhāna conditions, and the truths sets a cleaner editorial bar for later expansion. - The current
SNspine now covers dependent origination, the burden, the foam similes, the all, solitude through non-clinging, the eightfold path, the nutriments of hindrances and awakening factors, the refuge of four satipaṭṭhānas after Sāriputta’s passing, the five faculties, stream-entry factors, and the truths defined through the aggregates. ExtendSNby preserving this leverage-first logic. - For
KNmanual 2026 translation work, begin withKhuddakapāṭha(kp1-kp9) as a single editorial cluster. Those texts are short, foundational, and often liturgical, so preserve the chant body itself before adding any brief framing notes. - The next
KNeditorial foothold afterKhuddakapāṭhaisSutta Nipātaatsnp1.8,snp2.4, andsnp3.7. KeepMettāandMaṅgalachantable and route-specific, whileSelashould retain its arc of recognition, praise, ordination, and realization. DNmanual 2026 coverage is now complete. When revisingDN, assume the task is to improve fidelity, cadence, or explanatory framing rather than to fill missing routes.MNmanual 2026 coverage is now complete. ForMN, assume the next tasks are editorial upgrades, doctrinal tightening, or prose refinement, not missing-file backfill.- The manual 2026 Vietnamese loader is now file-driven.
src/data/nikaya-improved/vi/index.tsdiscovers*.tsmodules withimport.meta.glob, andsrc/data/nikaya-improved/availability.tsderives coverage from that set. Do not rebuild a hand-maintained import map. - Use
node scripts/generate-manual-2026.mjs <dn|mn|sn|an|kn>to scaffold missing manual modules. It preserves existing curated files and writes canonical hyphenated filenames such asmn-6.ts,an-1-10.ts, orsn-56-11.ts. docs/manual-2026-agent-prompts.mdis the reusable prompt pack for delegating manual 2026 work. Reach for it when the user asks for prompts, when a new agent needs authoring instructions, or when you want a sharper editorial QA loop.- When using that prompt pack, keep source roles disciplined: English is the semantic lock, HT. Thích Thanh Từ is the stylistic and pedagogical comparator only when the source is actually present, and HT. Thích Minh Châu is the local terminology and route-structure control. Never blur those jobs together.
- That prompt pack now treats summary-style route files as incomplete. If you encounter one, revise it into a full body translation before calling the route publication-grade.
AN 1.170-187should be authored as one coherent Tathāgata cluster.an1.170-174define the Buddha's singular appearance,an1.175-186unfold the liberating capacities that appear with him, andan1.187closes with Sāriputta as the rightful continuer of the Wheel. The grouped shell foran1.175-186must be restored into distinct child titles and not left as twelve copies ofNhư Lai.worklog-translate-2026.mdis the live queue for manual 2026 authoring. Keep it current after every batch so future agents can resume without reconstructing progress from audits and scattered task logs.AN 1.188-197is a disciples-of-distinction cluster. The routes are short, but each one names a precise excellence that should stay intact.an1.197is especially important because it models how to expand a brief saying faithfully, which is also the editorial discipline manual 2026 itself depends on.AN 1.198-208continues the foremost-disciples lane but changes texture.an1.198-200name subtle interior attainments and must stay semantically exact.an1.201-206should read as a sequence of communal virtues, not six isolated compliments.an1.207-208must protect two delicate meanings: Sīvali is not a mascot for material luck, and Vakkalī is not a mascot for irrational faith.AN 1.209-218shifts again. The opening pair is about trainability and faith. The middle stretch reveals the concrete beauty of a functioning sangha, from meal-order detail to lodging assignments and beloved presence. The closing triad must distinguish three nearby but different excellences: immediate penetrative insight, luminous preaching, and the unobstructed analytic knowledges.AN 1.219-234must be handled as a structured portrait, not a long flat list.an1.219-223are really five faces of Ānanda as the carrier of the teaching. Where English and Minh Châu diverge, use the Pali root and the cluster logic to decide the manual phrasing.an1.224-230broaden into community health and instruction.an1.231-234then close with four hard-edged excellences that should never be swapped or blurred: admonishing monks, mastery of fire, awakening eloquence, and coarse-robe austerity.AN 1.235-247is the first major bhikkhunī cluster. Write it so the ni lineage stands in its own authority. Do not reduce the group to generic praise of “female disciples.” The structural spine is elderhood, wisdom, psychic power, Vinaya, Dhamma speech, meditation, energy, clairvoyance, quick insight, recollection of past lives, great realization, rough-robe austerity, and deep faith.AN 1.248-257is the first major male lay follower cluster. Keep the range wide: first refuge, generosity, Dhamma speech, social cohesion through the four saṅgahavatthus, refined giving, Sangha support, experiential confidence, person-centered confidence, and intimate trust. The last three routes are easy to flatten or mistranslate. Use the Pali rootsaveccappasanna,puggalappasanna, andvissāsakato keep them distinct.AN 1.258-267is the matching female lay follower cluster. Keep the sequence visibly varied: first refuge, generosity, great learning, loving-kindness, meditation depth, excellent giving, care for the sick, unwavering confidence, intimate trust, and confidence grounded in hearing. The last three routes are again easy to flatten. Keepaveccappasannaas confidence made steady by verification,vissāsikāas intimate trustworthy closeness, andanussavappasannaas confidence born from hearing and transmission, not rumor.AN 1.268-277is the first impossibility cluster after the lay-follower material. Keep the formula alive: one accomplished in right view cannot do or believe these things, while an ordinary person still can. Do not flattendiṭṭhisampannointo mere correctness of opinion. The block moves from wrong perception of conditioned things, to impossibility of the gravest acts, to the singularity of one Buddha in one world-system.AN 1.278-286continues the same impossibility cluster. Preserve the progression from one wheel-turning monarch in one world-system, to impossible cosmological role claims, to the law that bad bodily, verbal, and mental conduct cannot ripen into agreeable results. For grouped source rowsan1.281-283andan1.285-286, write exact route-level manual modules rather than leaving the child routes semantically collapsed.AN 1.287-295completes the first impossibility cycle with the positive mirror of the same karmic law. Keep the symmetry visible: good conduct cannot ripen into disagreeable results, bad conduct cannot lead upward after death, and good conduct cannot lead downward after death. Split grouped source rows into exact route-level manual modules so each body, speech, and mind route remains independently readable.AN 1.296-305opens the first recollection cluster of the One Thing chapter. Preserve the repeated arc in every route: developed and cultivated, this one thing leads to disillusionment, dispassion, cessation, peace, direct knowledge, awakening, and nibbāna. Split grouped source rows so each recollection remains route-exact: Buddha, Dhamma, Saṅgha, ethics, generosity, deities, breathing, death, body, and peace.AN 1.306-315is the seed and view cluster. Keep the three-step movement intact: wrong and right view as engines of decline or growth, irrational and rational application of mind as their near causes, and finally the bitter seed and sweet seed similes that show how view flavors every action, intention, wish, and outcome. The final pair must feel climactic.AN 1.316-332is a three-part block. Keepan1.316-317as the public force of wrong and right view,an1.320-327as the mirrored cluster on badly and well explained Dhamma, andan1.328-332as the disgust similes for even a finger-snap of becoming. Even though English visible routesan1.330-332are upstream gaps, the grouped Sujato line and Minh ChâuTTC 14-17are sufficient to restore the manual routes exactly if you do not add doctrine beyond the repeated template.AN 1.575-615is akāyagatāsatimega-block where the local child files are structurally misleading. Use the grouped Bilara author endpoint.../bilarasuttas/an1.575-615/sujato?lang=en, not the child JSON shells, then align it with Minh ChâuTTCanchors.- Within that block,
an1.576-582must be split into seven precise fruits of body-based mindfulness in this order: urgency, benefit, sanctuary from the yoke, mindfulness and awareness, knowledge and vision, present-life happiness, and knowledge with liberation. Do not leave them merged. - The next sub-clusters in the same block also have shape and should not be flattened.
an1.586-590are the five abandonment results,an1.591-595are the analytic-penetration results,an1.596-599are the four fruits, andan1.600-615are a wisdom ladder of sixteen distinct qualities. Keep titles and prose tight, doctrinally exact, and route-specific. AN 1.616-627is the closingamatamirror for the whole Book of the Ones. Preserve each verb difference. Enjoy, have enjoyed, lose, miss out, neglect, forget, cultivate, develop, make much of, have insight into, completely understand, realize. The whole ending depends on that fine-grained variation.AN 2.1-10opens the Book of the Twos with a wider register than the late one-line pairs of Book One. Letan2.1andan2.5breathe as full discourses. Then keepan2.6-9as one ethical cluster where bondage, conscience, prudence, and protection of the social world build on each other.AN 2.11-20is the first doctrinal staircase of Book Two. Keepan2.11-13visibly cumulative, from reflective discernment, to the learner's training-power, to the same power expressed through awakening factors and the four jhānas. Then widen the prose foran2.14-20: two teaching modes, the two sides of a monastic dispute, karmic consequence, abandoning the unwholesome and cultivating the wholesome, and the precise conditions that make the true Dhamma decay or endure.an2.15,an2.17, andan2.20should sound like full discourse bodies, not aphorism shells.AN 2.21-31is the first ethics-and-interpretation cluster of Book Two. Do not leave all child routes under the parent labelBālavagga. Recover exact route identity.an2.21is about seeing one's fault and rightly accepting confession.an2.22-25are a single hermeneutics block: motive-based distortion, false attribution, and then the explicit contrast between discourses requiring interpretation and discourses whose meaning is already explicit.an2.26-29move into karmic destination through concealment, view, and virtue.an2.30-31then reopen the horizon, solitude for present happiness and compassion for later generations, and the paired training of serenity and insight. Keep that whole inner architecture visible in titles and prose.AN 2.32-41is the first uneven-weight block of Book Two, and the agent has to resist false uniformity.an2.32-35are compact but still route-distinct, gratitude, repaying parents, action and inaction, and worthy fields of giving.an2.36-38are full discourse bodies and need scene, speaker, and doctrinal turn preserved.an2.36must keep the distinction between internal fetters, external fetters, and the Buddha's later correction about where the deities cultivated their minds.an2.37-38are Mahākaccāna dialogues and should not be flattened into general moral paraphrase.an2.39-41tighten again into short teachings on institutional strength, right conduct, and preserving both wording and meaning.AN 2.42-51is a community-governance ladder. Do not leave all child routes under the shell titleParisavagga.an2.42-46are paired diagnostics of assembly quality, shallow and deep, divided and united, inferior and superior, ignoble and noble, cặn bã and tinh hoa.an2.47-48are the two routes where the prose must lengthen a little, because they turn to how a community listens, questions, and relates to gain.an2.49-51compress back into procedural and doctrinal integrity, lawful acts, lawful community, and right conduct in disputes. Keep the titles and prose visibly paired all the way through.AN 2.52-63rises by tiers insidePuggalavagga.an2.52-56identify exceptional persons and awakened types.an2.57-59use the image of thunder to test composure, so keep the animal comparison crisp and forceful.an2.60-61pivot into truthfulness and hunger that never feels satisfied.an2.62-63are the communal summit of the block, admonition, coexistence, quarrel, bitterness, and the conditions for conflict either to harden or to calm. Do not translate those two as soft moral abstracts.AN 2.64-76is a happiness ladder, not thirteen interchangeable aphorisms. The agent must preserve the repeated frame while letting each pair keep its doctrinal edge: lay and renunciate, sensual and renunciant, attached and unattached, defiled and undefiled, material and non-material, noble and ignoble, bodily and mental, with rapture and without rapture, pleasure and equanimity, with immersion and without immersion, and finally form-bound versus formless. Repetition here is structure, not filler.AN 2.77-86must read like a precise dismantling manual for unwholesome states. The doctrinal work is lexical accuracy: sign, source, cause, fabrications, condition, form, feeling, perception, consciousness, conditioned object. Keep each route minimal because the source is minimal, but make the distinction between the ten supports visible and audible.AN 2.87-97is a lexical-precision block. Most routes are only one sentence long, so the title does a lot of doctrinal work. Do not use vague headings. Make the paired terms exact and balanced: liberation of heart and liberation by wisdom, conscience and prudence, hard-to-correct and bad friendship, easy-to-correct and good friendship, skill in elements and skill in wise attention, skill in offenses and skill in emergence from offenses.AN 2.98-117is the first overt fool-and-wise mirror of Book Two. Do not leave the routes under the parent shellBālavagga. Recover the exact contrast in each title and keep the internal turn visible.an2.98-107are paired judgments, what burden to carry, what is allowable, what counts as offense, what is truly Dhamma, what is truly training.an2.108-117then restate the same field through the growth or non-growth of the taints. The second half should sound more consequential, not merely repetitive.- In
AN 2.109-117, keep the diction spare but not weak. The body can stay short because the source is short, yet the title and cadence must signal consequence. These are not just right views in the abstract. They are the conditions under which taints either keep swelling or stop gaining ground. AN 2.118-129changes shape mid-block. The first five routes are about hopes, gratitude, contentment, hoarding, and waste, so the prose may stay human and concrete. The next four are doctrinally sharper and must keepsubhanimitta,paṭighanimitta,parato ghoso,ayoniso manasikāra, andyoniso manasikārastraight in meaning even if rendered in lucid Vietnamese. The final three are technical Vinaya categories of offense. Do not blurlight,serious,coarse,not coarse,with residue, andwithout residue.AN 2.130-140is the first aspiration block and the first one in Book Two where several routes clearly require fuller bodies again.an2.130-133are aspiration formulas anchored in exemplars. Keep the phrasecán cânorchuẩn mựcalive so the routes remain normative, not sentimental.an2.134-137are paired fool-versus-true-person discourses and must preserve both halves.an2.138-140then strip back to minimal dyads. The skill here is modulating length without losing coherence.AN 2.141-150is a short-form giving cluster where the challenge is lexical precision, not expansion. Each route is brief, but each one turns on a different social verb, giving, offering, relinquishing, surrendering, possessing, enjoying together, sharing, including, supporting, sympathizing. Keep each route as a distinct child file and letchánh phápremain the clearly superior counterpart in every closing line. Do not let the repeated pattern tempt you into one generalized block summary.AN 2.151-162is the receiving-and-flourishing mirror of the prior giving cluster. The doctrinal move stays the same, material form versus Dhamma form, but the social verbs change fast: welcoming, hosting, seeking, searching more broadly, inquiring, honoring, treating guests, succeeding, growing, treasuring, accumulating, expanding. Keep the titles and prose exact enough that a reader can tell one route from the next without losing the shared refrain.AN 2.163-179changes register from social exchange to discipline and contemplative craft. Treat it as one shaped practice-cluster, not seventeen detached glosses.an2.168-169must feel like a corrective pair.an2.170-172should sound stronger and more inward.an2.173-176are not abstract philosophy but the moral and cognitive spine of the path.an2.177-179are the closing pressure points of the block, never complacent in wholesome states, never lax in effort, then the stark contrast between heedless mind and mindful clear comprehension.AN 2.180-229is the first large Book Two peyyāla machine. The only safe way through it is by matrix. Keep the five moral pairs stable, anger and grudge, disdain and spite, jealousy and stinginess, deceit and deviousness, shamelessness and recklessness. Then keep each five-route tranche tied to its governing predicate: bare statement, bright opposite, suffering now, happiness now, decline, non-decline, hell, heaven, bad rebirth, good rebirth. If you lose the matrix, the translations turn into noise.AN 1.333-347is a rarity ladder. Keep thefew and manyrhythm alive as the routes climb from rare favorable birth and favorable lands, to rare discernment and noble wisdom-eye, to rare encounter with Tathagata and Dhamma, to rare retention, reflection, practice, samvega, right effort, samadhi based on letting go, and finally the rare taste of meaning, Dhamma, and liberation inan1.347.an1.347must feel climactic.AN 1.348-377is a rebirth matrix. Do not flatten grouped triples into abstract summaries. Each route must preserve one rare rebirth target and one exact common fall destination. Organize the prose by source realm, human, gods, hell, animals, ghosts, and keep the doctrinal force plain: favorable rebirth is rare, downward drift is common, and neither pain nor pleasure guarantees wisdom.AN 1.378-393is an inspiring-qualities cluster. Keep the block tiered, not flat.an1.378-381are renunciant disciplines,an1.382-388are teaching, Vinaya, learning, bearing, and communal influence, andan1.389-393are social or bodily traits that can help others open in trust. Preserve the repeated forceworth having, but do not inflate good family, physical beauty, or health into proofs of liberation. They are confidence-supporting conditions, not the goal.AN 1.394-401is the first finger-snap cultivation cluster. Keep the eight routes as a single shaped unit: first through fourth jhāna, then loving-kindness, compassion, rejoicing, and equanimity. The doctrinal center is the repeated refrain, not the bare title of the state. Even a finger-snap of true cultivation means the monk is not empty in meditation, follows the Teacher, responds to advice, and does not consume the country's alms in vain. Let that refrain stay alive in every manual file.AN 1.402-423is the next finger-snap training arc. Keep the shape explicit: four establishments of mindfulness, four right efforts, four bases of spiritual power, five faculties, and five powers. The repeated refrain still matters more than the list itself. Each route says that even a finger-snap of real cultivation in this frame is enough to make the monk not empty in meditation, responsive to instruction, and worthy of alms. Preserve both the exact framework and the dignity of the brief true effort.AN 1.424-438continues the same finger-snap curriculum through the seven awakening factors and the noble eightfold path. Keepan1.424-430as a genuine developmental chain, mindfulness, investigation, energy, joy, tranquility, immersion, equanimity, and keepan1.431-438as the exact order of the path. These routes are short but not thin. Each one carries a distinct doctrinal function plus the same strong refrain that even a brief true moment of cultivation is not spiritually empty.AN 1.439-454shifts from the finger-snap curriculum into the contemplative deep-structure of the chapter. Treatan1.439-446as the eight mastery bases andan1.447-454as the eight liberations. Do not flatten them into decorative meditation language. The first block is about mastery over perception in increasingly subtle visual fields. The second block is about release through progressively subtler configurations, from form, to purified perception, to the immaterial attainments, to cessation. Keep the prose lucid, exact, and restrained.AN 1.455-464is the ten-kasina block and should stay visibly shaped. First come earth, water, fire, and air. Then the blue, yellow, red, and white kasinas. Finally the arc opens further into space and consciousness. Preservebiến xứas a technical term, and let the prose show the deepening movement from coarse support to subtle field without turning the block into vague mystical atmosphere.AN 1.465-474is the ten-perception block and should not be flattened. The first four perceptions strip glamour away from the world of craving. The next three form an insight ladder, impermanence, suffering, not-self. The last three turn that insight into release, giving up, fading away, cessation. Keep each route lean, but preserve the whole arc.AN 1.475-484is the next perception block and changes register halfway. The first five routes are short reset-perceptions. The next five are corpse contemplations and must keep their severity. Do not soften the imagery just to make it more comfortable; their job is precisely to cut attachment to bodily glamour.AN 1.485-494is the recollection block and needs a different register from the harsher perception clusters before it. The prose should be clear, warm, and steady without getting sentimental. These routes are meant to give the mind reliable supports, from the six classic recollections through breathing, death, body, and peace.AN 1.495-504is the first-jhāna faculties-and-powers block. Treatan1.495-499andan1.500-504as two matched pentads. The key editorial job is to preserve the doctrinal ascent fromcăntolực, from growing capacity to stabilized strength, without turning the ten routes into ten near-identical notes.AN 1.505-514is the same matched pentad structure shifted into the second jhāna. The content should not sound mechanically recycled fromAN 1.495-504. Keep the quieter, more unified flavor of nhị thiền audible, while still marking the rise from faculty to power.AN 1.515-524repeats the matched pentads in the third jhāna. The editorial job is not to inflate doctrine, but to make the tonal descent audible: less bright than nhị thiền, more settled, more cool, more balanced. Preserve both axes, from faculty to power and from nhị thiền to tam thiền.AN 1.525-534shifts the same pentads into the fourth jhāna. The prose should be the cleanest of the four jhāna blocks: more even, more purified, less affective, and more unmistakably grounded in equanimity and clarity. Keep both transitions explicit, from faculty to power and from tam thiền to thiền thứ tư.AN 1.535-544leaves the jhāna ladder and enters the mettā pentads. The prose should open out: warmer, wider, less technical, but still exact. Keep both transitions explicit, from faculty to power and from fourth-jhāna purity into loving-kindness as a lived, non-hostile mode of mind.AN 1.545-554repeats the same structural ladder under compassion. Do not write it as generic kindness with a darker mood. The key color is nearness to suffering without collapse. Keep karuṇā distinct from grief, keep the faculty to power turn visible, and let the final route close the whole compassion block rather than sounding like one more isolated aphorism.AN 1.555-564repeats the ladder under sympathetic joy. This block should sound brighter than compassion but still disciplined. Keep hỷ distinct from excitement, pleasure, pride, or victory. The prose should feel open and clean, free from envy, and the final route should show that wisdom can rejoice without losing balance.AN 1.565-574repeats the ladder under equanimity. This tranche should sound level and spacious, but never deadened. Keep xả distinct from indifference. Also preserve the special closing force ofan1.574, where the grouped source restores the explicit refrain about not being barren of jhāna and not eating alms in vain. This block is the first one that should fully embody the repo's stricter full-body translation standard.
Nikaya State Machine
stateDiagram-v2
[*] --> RawJsonPresent
RawJsonPresent --> GroupedIdsResolved
GroupedIdsResolved --> ContentAudited
ContentAudited --> OriginalLayersAudited
OriginalLayersAudited --> MetadataParityAudited
MetadataParityAudited --> ManifestSynced
ManifestSynced --> RenderFidelityAudited
RenderFidelityAudited --> DetailSelectable
DetailSelectable --> BrowserVerified
BrowserVerified --> ReaderWarned: grouped block only
RawJsonPresent --> RawJsonPresent: refetch if metadata only
GroupedIdsResolved --> RawJsonPresent: grouped route absent locally
GroupedIdsResolved --> ContentAudited: range-position slice available
ContentAudited --> RawJsonPresent: Bilara composition defect
OriginalLayersAudited --> RawJsonPresent: Minh Chau provenance mismatch
MetadataParityAudited --> GroupedIdsResolved: alias target or nav defect
ReaderWarned --> DetailSelectable: exact source becomes available
BrowserVerified --> DetailSelectable: UI regressionManual 2026 Loader
stateDiagram-v2
[*] --> IndexRowKnown
IndexRowKnown --> FilenameCanonical
FilenameCanonical --> ModuleWritten
ModuleWritten --> GlobDiscovered
GlobDiscovered --> AvailabilityDerived
AvailabilityDerived --> TriadAudited
TriadAudited --> BuildVerified
BuildVerified --> [*]
FilenameCanonical --> IndexRowKnown: file naming fix
GlobDiscovered --> ModuleWritten: export shape invalid
TriadAudited --> ModuleWritten: coverage still missingsequenceDiagram
participant Index as nikaya_index.json
participant Script as generate-manual-2026.mjs
participant Files as src/data/nikaya-improved/vi/*.ts
participant Loader as vi/index.ts
participant Availability as availability.ts
participant Audit as audit-nikaya-triad.mjs
Index->>Script: collection metadata rows
Script->>Files: scaffold missing modules
Files->>Loader: eager glob discovery
Loader->>Availability: normalized sutta IDs
Availability->>Audit: manual coverage set
Audit->>Audit: confirm triad completenessflowchart LR
A[nikaya_index.json] --> B[generate-manual-2026.mjs]
B --> C[src/data/nikaya-improved/vi/*.ts]
C --> D[vi/index.ts]
D --> E[availability.ts]
E --> F[audit:nikaya]
D --> G[Nikaya reader]Nikaya Source-Gap Flow
flowchart LR
A[Route id plus language] --> B[canonical-aliases.json]
B --> C[src/lib/nikaya-source-gaps.ts]
C --> D[NikayaDetail coverage notice]
C --> E[Audit summary]
E --> F[No fabricated original content]Nikaya Sequence
sequenceDiagram
participant Agent
participant File
participant RawManifest
participant EffectiveManifest
participant Alias
participant Parser
participant Index
participant Originals as audit-nikaya-originals
participant Fidelity as audit-nikaya-render-fidelity
participant Detail
participant Browser
Agent->>File: inspect one sutta JSON
Agent->>RawManifest: compare available.json vs content-availability.json
Agent->>EffectiveManifest: compare effective route coverage against UI expectations
Agent->>Index: inspect grouped range IDs when the collection is peyyala-heavy
Agent->>Parser: confirm KN book prefixes resolve to the kn directory
Agent->>Parser: patch Bilara composition if needed
Agent->>Originals: audit readable EN, readable Minh Chau VI, alias ids, title parity, and canonical nav continuity
Agent->>Fidelity: audit exact vs grouped render quality on visible routes
Agent->>Alias: verify child routes resolve to the correct grouped canonical
Agent->>Index: prefer child-row metadata over grouped canonical metadata on alias detail routes
Parser->>Parser: scope grouped Bilara by child prefix or range position
Parser->>Parser: scope grouped Minh Chau HTML by subrange ids or TTC chunks
Parser->>Detail: return rendered HTML only when content exists
Detail->>Alias: hide grouped fallback canonicals from the public library list
Detail->>Detail: keep grouped fallback canonicals off the indexable SEO surface
Detail->>Browser: expose only the curated 3-option selector
Detail->>Browser: warn when a version is only a grouped block
Browser->>Agent: confirm readable EN outputNikaya Data Flow
flowchart LR
A[Raw sutta JSON] --> B[Content audit]
X[Grouped range IDs] --> B
A --> H[Original layers audit]
A --> Y[Render fidelity audit]
A --> N[Remote gap audit]
A --> L[Index generation]
B --> C[content-availability.json]
B --> I[effective-content-availability.json]
B --> J[canonical-aliases.json]
H --> C
N --> O[Repair mode]
O --> A
L --> M[nikaya_index.json]
M --> X
M --> F
M --> G
A --> D[suttacentralLocal parser]
D --> E[Rendered HTML]
Y --> G[NikayaDetail notices]
X --> F[Library grouped-route pruning]
J --> K[SEO noindex gating]
I --> F[NikayaLibrary badges]
I --> G[NikayaDetail dropdown]
J --> G
E --> GState Machine
stateDiagram-v2
[*] --> SourceReviewed
SourceReviewed --> Chapterized
Chapterized --> ModuleWired
ModuleWired --> MetadataRegistered
MetadataRegistered --> RouteVerified
RouteVerified --> ReleaseLogged
ReleaseLogged --> ReadyToPublish
RouteVerified --> ModuleWired: import or chapter mismatch
RouteVerified --> MetadataRegistered: summary or theme defectSequence
sequenceDiagram
participant Source
participant Markdown
participant Module
participant Metadata
participant Route
participant TaskLog
Source->>Markdown: translated, segmented chapters
Markdown->>Module: ordered raw imports
Module->>Metadata: title, summary, author, themes
Metadata->>Route: slug becomes loadable
Route->>TaskLog: route target and release notesData Flow
flowchart LR
A[Short source text] --> B[Markdown chapters]
B --> C[Teaching module]
C --> D[Metadata registry]
C --> E[TeachingDetail lazy import]
D --> F[DhammaLibrary listing]
E --> G[Teaching route]
G --> H[Task log and release verification]State Machine
stateDiagram-v2
[*] --> InspectPDF
InspectPDF --> SegmentSections
SegmentSections --> ExtractText
ExtractText --> RepairOCR
RepairOCR --> PreserveAppendices
PreserveAppendices --> DraftVietnamese
DraftVietnamese --> RegisterTeaching
RegisterTeaching --> VerifySite
VerifySite --> PublishFrontend
PublishFrontend --> Published
DraftVietnamese --> PreserveAppendices: source artifact blocks phrasing
VerifySite --> RepairOCR: extraction defect
VerifySite --> RegisterTeaching: integration defectSequence
sequenceDiagram
participant Agent
participant PDF
participant Script
participant Corpus
participant Site
participant GitHubPages
Agent->>PDF: inspect TOC, headings, appendix pages
Agent->>Script: encode section boundaries
Script->>PDF: extract text, lines, footnotes
Script->>Corpus: write English markdown
Agent->>Script: inject appendix image strategy
Script->>Corpus: write cleaned English corpus
Agent->>Corpus: hand-translate chapter where ready
Corpus->>Site: vi chapter or en fallback
Agent->>Site: register teaching module and metadata
Site-->>Agent: build result and route validation
Agent->>GitHubPages: push main after checks passData Flow
flowchart LR
A[scrnguna.pdf] --> B[Section map]
B --> C[Line extraction]
C --> D[Body cleanup]
C --> E[Footnote parsing]
D --> F[English markdown chapters]
E --> F
A --> G[Rendered appendix pages]
G --> H[Public image assets]
F --> I[Manual Vietnamese chapters]
F --> J[English fallback corpus]
I --> K[Teaching TS module]
J --> K
H --> K
K --> L[Metadata + route wiring]
L --> M[Local build]
M --> N[GitHub Pages deploy]Practical Rules
- Never trust automatic footnote placement on biography or front-matter pages. Only annotate numbers that actually exist as page footnotes.
- Run a dedicated front-matter QA pass. Cover pages, title pages, and library stamps often OCR into duplicated headings, isolated capitals, and other debris that must be rewritten into clean editorial prose before publication.
- Do not flatten tables or diagrams into broken prose. Preserve them as images with short textual summaries.
- Keep chapter files stable across reruns by using explicit numeric prefixes in filenames.
- Protect Pāli doctrinal vocabulary when translating. A bad translation of a key term is worse than leaving the term in transliteration.
- Treat the English markdown as the canonical extracted source.
- If the Vietnamese chapter is not yet elegant, doctrinally precise, and readable aloud, do not force publication. Let the module fall back to English.
- For this repo, a content-only release normally means frontend publish only.
- If a teaching grows large enough to create an oversized route chunk, prefer chapter-level
loadContentloaders over eager raw markdown imports so the reader can hydrate progressively. - Site verification now runs on Vite 8. Keep
manualChunksfunction-based invite.config.ts, and if chart routes fail under production bundling, confirmreact-isis installed forrecharts. - Do not reintroduce a forced
vendor-markdownchunk for the KaTeX reader stack. On this repo, Rolldown can emit a brokenkatex_min_exportssymbol whenkatexandrehype-katexare grouped too aggressively. - If math pages need lazy styling, keep
useKatexCSSon the stylesheet-URL path. Avoid dynamic CSS module imports forkatex.min.cssunless you verify the emitted chunk graph in production. - During route QA, inspect the page chrome as well as the manuscript body. Mis-scoped i18n keys such as
t('common.exportPdf')can surface raw keys even when the content itself is clean.
Review Checklist
- Section ordering matches the source PDF.
- Page-scoped footnote labels are unique.
- No obvious split-word artifacts remain around footnote markers.
- Appendix pages render upright and at readable width.
- Metadata title, summary, difficulty, and themes match the manuscript.
- The teaching route resolves with chapter ordering intact.
- If the teaching is surfaced from
Pháp Bảo, confirm the back link returns to/phap-bao/giao-phapand not the generic library root. - If the route is public, confirm
dist/<route>/index.htmlcontains the expected canonical and JSON-LD after build. - Site build passes after wiring.
- Pages deploy is triggered from
main.