شعار Recipe Reader

Recipe Reader

المجتمع
Kimeur
recipe-reader

Creates a complete SwiftUI reading app for iPhone Duo, Apple's foldable: a library shelf, then one page on the closed outer display, two facing pages split at the fold when the phone is open and held wide or folded like a book, and in tabletop the page above the fold with the page turns below it. Use when someone wants to start a new e-reader, book, story, essay or long-form reading app from scratch, or runs /duo-new recipe-reader. For an existing reader, use duo-reading instead. Covers the reading place kept as a chapter and character offset in a store above the navigation stack, TextKit 1 pagination that runs again after every fold, rotation and Dynamic Type change, ReaderLayout reading the .division reserved region, an even-column shelf split at the fold, an in-app text size menu, swipe and VoiceOver page turns, three sample books written for the template, a Foundation-only model tested on the Mac (the paginator too, through AppKit), and UI tests that work on the iPhone Duo simulator.

نظرة عامة

الناشرKimeur
المستودعduology
اسم المهارةrecipe-reader
النجوم
40
التفريعات
2
الملفات المرفقة
43
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 43

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها Kimeur على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Recipe Reader في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/Kimeur/duology/tree/main/plugins/duology-recipes/skills/recipe-reader
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Kimeur/duology.git /tmp/duology
mkdir -p .claude/skills
cp -r /tmp/duology/plugins/duology-recipes/skills/recipe-reader .claude/skills/recipe-reader
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Recipe Reader في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج Recipe Reader تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Recipe Reader بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تترتب أي تكلفة على المهارة غير المستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

recipe-reader

This recipe makes a new Xcode project: a reading app for iPhone Duo. The library shows a shelf of books and the one you were reading. A book opens on one page when the phone is closed and on two facing pages when it opens, split at the fold like a paper book. Set the phone on a table half folded and the page sits above the fold, with big page turns below it. Close it, open it, fold it, turn it or change the text size: the words you were reading stay on screen.

The books are sample content. The value is the frame around them: a place that no layout change can lose, pages that always break where the page ends, rules you can test on the Mac in seconds, and UI tests that pass on the Duo simulator.

Labels: measured means we ran it on the iPhone Duo simulator (iOS 27.1, 20 October 2026). Unverified means we could not check it. Everything else links to Apple. "Book" and "tabletop" are Duology's words for Apple's "partially folded, like a book" and "seated on a table like a laptop"; no API reports them. Full source list: reference/sources.md.

Use a different skill when:

  • the app already exists: use duo-reading (the same pagination and reader, as code to add) and duo-continuity;
  • the app plays video or audio: use recipe-media-player.

1. Create the project

/duo-new recipe-reader runs steps 1 to 5. Run every step yourself when there is no command.

  1. Get three values from the user, or propose them:

    • AppName: letters and digits, starting with a letter (it becomes a Swift type, <AppName>App). Not Tools, and not an Apple module name such as SwiftUI or UIKit;
    • a bundle id such as com.example.shelfie;
    • a new, empty folder.
  2. Run the script from this skill's folder (in the plugin: ${CLAUDE_PLUGIN_ROOT}/skills/recipe-reader/scripts/new-project.sh):

    bash
    "${CLAUDE_PLUGIN_ROOT}/skills/recipe-reader/scripts/new-project.sh" \
      Shelfie com.example.shelfie ~/Developer/Shelfie

    It copies template/, replaces __APP_NAME__ and __BUNDLE_ID__ in file contents and paths, checks none are left, and prints the next steps. It refuses a folder that exists and is not empty (exit 73), and bad or clashing names (exit 65), before it creates anything.

  3. Test the rules on the Mac. Expect 0 failed:

    bash
    cd ~/Developer/Shelfie && Tools/run-model-tests.sh
  4. Build for the Duo simulator (find its UDID with xcrun simctl list devices available | grep "iPhone Duo"):

    bash
    DEVELOPER_DIR=/Applications/Xcode-27.1.app/Contents/Developer \
    xcodebuild -project Shelfie.xcodeproj -scheme Shelfie \
      -destination "platform=iOS Simulator,id=<UDID>" \
      -derivedDataPath build/DerivedData build
  5. Install, launch straight into a book, and screenshot the display in use. Use the UDID, not booted.

    bash
    DEV=/Applications/Xcode-27.1.app/Contents/Developer
    DEVELOPER_DIR=$DEV xcrun simctl install <UDID> build/DerivedData/Build/Products/Debug-iphonesimulator/Shelfie.app
    DEVELOPER_DIR=$DEV xcrun simctl launch --terminate-running-process <UDID> com.example.shelfie -open keeper -chapter 0 -offset 2400
    DEVELOPER_DIR=$DEV xcrun simctl io <UDID> screenshot --display=primary build/outer.png     # closed
    DEVELOPER_DIR=$DEV xcrun simctl io <UDID> screenshot --display=primary-1 build/inner.png   # open

    Only the display in use has content. Look at the PNG before you report.

  6. Run the UI tests: DESTINATION="id=<UDID>" Tools/run-ui-tests.sh. A UI test brings the app to the front; tell the user first if they share the simulator.

  7. Tell the user what passed, and that poses change only in Device Hub (the checklist below).

Set DEVELOPER_DIR for every xcrun and xcodebuild call when the Mac has more than one Xcode. Never run xcode-select.

2. What you get

PathWhat it holds
<App>/Model/Library, chapter text, reading places, page breaks and turns, the reader's layout, the shelf's columns, fold geometry. Foundation and CoreGraphics only, every type nonisolated and Sendable.
<App>/Text/Paginator.swiftTextKit 1 page breaks. UIKit in the app, AppKit in the Mac tests.
<App>/Reader/ReaderScreen (layout, pagination, turns, menus, tabletop controls), PageView with a TextKit 1 UITextView, TextStyle (serif body at the reader's Dynamic Type size).
<App>/Library/The shelf (ShelfLayout), book tiles, the Continue Reading card, drawn covers.
<App>/App/App entry, RootView (the navigation stack), LibraryStore (places, saved as JSON), launch switches.
<App>/Shared/onFoldChange and the test marker.
<App>/Books/Library.json and eight chapters in three books, written for this template (about 6,400 words).
<App>UITests/Nine UI tests, pose-agnostic.
Tools/run-model-tests.sh, ModelTests/main.swift, run-ui-tests.sh.

Project settings: iOS 26.0 deployment, Swift 6 language mode, SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor, approachable concurrency, file-system synchronized groups (new files need no project edits), iPhone and iPad, a privacy manifest that declares UserDefaults (reason CA92.1) for the saved places. The scheme turns off parallel testing so xcodebuild doesn't clone the simulator.

Architecture, data flow and test details: references/architecture.md. Your own books, typography, Dynamic Type and what we measured in each pose: references/books-and-text.md.

3. How it behaves in each pose

PoseReader (measured, inside the navigation stack)PagesPage turnsShelf
Closed (outer display)382 × 562 ptonevertical bar on the sidetwo columns
Open, flat, held wide867 × 553 pt, fold flattwo, either side of the fold linevertical bartwo columns each side of the fold line
Book867 × 553 pt, fold activethe same two, so no new paginationvertical barthe same columns
Tabletop669 × 835 pt, fold active acrossone, above the foldbelow the fold, with Contents and Text Sizefour in a row; the shelf scrolls across the fold

Measured with Device Hub's pose buttons pressed by duo-pose, one app process through closed, open and book and another through tabletop and closed: at character 2,400 of the first chapter, the page on screen held it in every pose (closed page 4 of 7, open and book pages 3 and 4 of 8, tabletop page 4 of 7). Details: references/books-and-text.md.

4. Where each Duo technique lives

TechniqueWhereWhy
The place survives every foldReadingLog in LibraryStore, @State in RootViewState above a layout switch survives it (duo-continuity). The place is two numbers, saved on every change.
The place is an offset, never a pageReadingPosition, PageBreaks.page(containing:)Page breaks change with every fold, rotation and text size; the first character on screen doesn't (duo-reading).
Never skip unread textPageBreaks.firstPage(showing:perSpread:)A spread starts on an even page, so the page holding the offset is always on screen, leading or trailing.
Pages split at the fold, not the middleReaderLayout, fed by onFoldChangereservedRegions(kind:options:layoutDirectionBehavior:) with .division and .includeInactive, on the reader's own frame. Measured: the fold's frame started at x 455.5 in an 867 pt reader, 22 pt right of its middle.
Folding doesn't paginate againPaginationKeyFlat and book give the same page size, so the key doesn't change when the fold turns active.
Tabletop: read above, turn belowReaderLayout mode .tabletop, tabletopControlsApple's optional per-pose layout: content in the top half, controls in the stable bottom half, the same controls as every other pose (talk 111466).
Page turns stay off the foldSystem bars; tabletop controls in their own regionToolbars move off the fold on their own (talk 111466).
Dynamic Type reflows the pagesTextStyle.attributed(_:size:), the type size in PaginationKeyThe text is built at the reader's size and paginated again; the offset keeps the place. The in-app Text Size menu moves the system size by steps.
Pages never overflowPaginator and PageTextViewBoth TextKit 1 (NSLayoutManager, NSTextContainer) with the same padding; UITextView(usingTextLayoutManager: false).
No size feedback.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) on the readerThe pages' sizes come from the measured size; a frame that grows to fit them would never shrink (duo-reading).
An even shelfShelfColumns, ShelfLayoutWhen a fold crosses a grid, flat or folded, use an even column count with the fold in a gutter (talk 111463).
VoiceOver page turnsaccessibilityScrollAction on the readerA three-finger swipe turns the page (accessibilityScrollAction(_:)).

5. Customise

Change the books and the rules first, then the look.

  • Your books: add them to Books/Library.json, one .txt file per chapter; blank lines separate paragraphs. File names must be unique across books. Run Tools/run-model-tests.sh: it checks every file is there and has text. More, including long books and EPUB: references/books-and-text.md.
  • Typography: TextStyle (font, line height, paragraph spacing, hyphenation) and PageInsets (margins, running head, page number, longest line). Paginator and pages share them, so change them in one place.
  • Looks: BookCover, BookTile, ContinueCard, PageView.
  • Add a model rule: write it in Model/, keep it nonisolated and Sendable, add a check in Tools/ModelTests/main.swift and a line to its off-main-actor check.

Keep these, whatever the app:

  1. The place is a chapter and a character offset, in a store above the navigation stack.
  2. Paginate again for a new page size, text size or chapter; show the page that holds the offset.
  3. One ReaderScreen for every pose; the first page is the same view in every mode. Never an if on the pose around the pages.
  4. Page regions from the fold's frame, never from half the width.
  5. The same controls in every pose. Tabletop moves them below the fold; it never adds or removes one.
  6. Paginator and page view on the same text engine, with the same padding and insets.

6. Test it

On the Mac: Tools/run-model-tests.sh builds Model/*.swift and Text/*.swift with the test program using swiftc -swift-version 6 -default-isolation MainActor, like the app target. It reads the real Library.json and every chapter, paginates the first chapter through AppKit and checks every character lands on exactly one page and the place stays on screen at three page sizes. The layout checks use the reader sizes and fold frames measured on the Duo simulator. Measured: 147 checks, under 10 seconds with the build.

On the simulator: Tools/run-ui-tests.sh. The tests start from launch switches (-open, -chapter, -offset, -textStep, -resetState), find elements by identifier, tap through element.coordinate(withNormalizedOffset:), and read the reader through the reader.state marker (book=keeper|chapter=0|offset=2400|first=2|pages=8|mode=spread|shown=1261-2546|step=0|ready=1|). Every test that moves the place checks the saved offset is inside shown. They never depend on the pose.

Measured: all nine passed on the Duo simulator open and held wide, about 115 s of tests, and testReaderLayoutInThisPose passed closed, in book pose and in tabletop. Set the pose in Device Hub (or with duo-pose), then run that test once per pose:

bash
Tools/run-ui-tests.sh -only-testing:ShelfieUITests/ShelfieUITests/testReaderLayoutInThisPose

Then check each pose by hand in Device Hub, or with duo-pose-matrix (needs the user's Accessibility permission):

bash
duo-pose-matrix com.example.shelfie --case "reader=-resetState -open keeper -chapter 0 -offset 2400"

To see the place survive the poses, pass --no-relaunch. For the shelf, launch once with -open bread -chapter 1 -offset 900 so Continue Reading has a book, then run the matrix with --case "library=" (no switches: the saved place stays).

Checklist

  • Project created with scripts/new-project.sh; no __APP_NAME__ or __BUNDLE_ID__ left.
  • Tools/run-model-tests.sh prints 0 failed.
  • xcodebuild … build succeeds for the iPhone Duo simulator with no warnings from your code.
  • The app launched on the Duo simulator; you looked at the screenshot of the display in use.
  • Tools/run-ui-tests.sh passes.
  • Closed: one page. Open and held wide, flat or like a book: two pages, no text inside the fold's frame.
  • Tabletop: the page ends above the fold; Previous, Next, Contents and Text Size sit below it.
  • Read to the middle of a chapter, then close, open, fold, rotate and close again: the same paragraph is on screen each time.
  • Text size from the smallest to AX5 (the reader's menu, or Settings): the pages reflow and the place holds.
  • The shelf: an even number of columns on the open phone, no cover on the fold, Continue Reading on the leading side.
  • VoiceOver reads the page and a three-finger swipe turns it, in every pose.

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة أثناء تحميل المهارة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Recipe Reader؟

Creates a complete SwiftUI reading app for iPhone Duo, Apple's foldable: a library shelf, then one page on the closed outer display, two facing pages split at the fold when the phone is open and held wide or folded like a book, and in tabletop the page above the fold with the page turns below it. Use when someone wants to start a new e-reader, book, story, essay or long-form reading app from scratch, or runs /duo-new recipe-reader. For an existing reader, use duo-reading instead. Covers the reading place kept as a chapter and character offset in a store above the navigation stack, TextKit 1...

لماذا تستخدم Recipe Reader على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Recipe Reader عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Recipe Reader في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/Kimeur/duology/tree/main/plugins/duology-recipes/skills/recipe-reader. يقرأ TypingMind ملف SKILL.md الخاص بها، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Recipe Reader؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Recipe Reader؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Recipe Reader معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Recipe Reader مجانية؟

نعم. نشرها Kimeur على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇