Dayward AIWeChat Mini Program
Agent Skills in 7 Days: Turn Experience Into Reusable Capability
Week 1 · D5🔒 LockedAbout 6 hours

Hand-Building a Skill Runtime: Scanning, Frontmatter Parsing, Injecting the System Prompt, Reading the Body on Demand

Actually build three-stage progressive disclosure: scan a directory to discover skills, parse frontmatter leniently, splice names and descriptions into a directory injected into the system prompt, and read the full body only on activation.

Today's goals 0/3

Sign in to tick these off and save your progress.

Today's Goals

  1. Implement a skill scanner that handles scope priority and name collisions
  2. Leniently parse SKILL.md frontmatter, degrading gracefully rather than crashing on malformed input
  3. Inject the directory into the system prompt, and implement an activation entry point that reads the body on demand

For four days you stood on the writing side: choosing a subject, writing the description, deciding when to add a script. Today you switch roles and write the program that reads skills. Not so you can build a client, but because once you have implemented it, you can point at the line of runtime code behind every recommendation of the last four days — why the description is the only trigger surface, why the body should stay within a few hundred lines, why the name must equal the directory name, all of it going from "the spec says so" to "the code does not work otherwise." Once you have read the walkthrough and finished the lab, scroll back to the top and tick off the three goals.

Plain-Language Walkthrough

The three stages are three functions in code

On day one, at the filing cabinet, you were the new hire coming to look things up. Today you become the person who keeps the cabinet: taking stock of which folders are in it, copying the line on each cover onto an index card by the door, and pulling out the matching folder only when someone asks about that subject.

Those three jobs are progressive disclosure's three stages, and in code they map cleanly onto three functions.

Discovery: scan a few conventional directories, find every folder containing a SKILL.md, and read out each one's metadata. This runs once at session start.

Disclosure: splice every skill's name and description into a catalog and put it in the system prompt. Not one word of any body comes in. That catalog is the model's only basis for judging whether there is something worth opening.

Activation: only once the model says it wants a skill do you read that one full SKILL.md and put its body into the context.

The genuinely valuable insight hides between steps two and three: disclosure's cost is paid every turn, and activation's cost is paid once. The system prompt is resent with every request, so every extra word in the catalog gets multiplied by the number of turns. A body enters the context only on the turn it is activated and then stays as a history message without being billed again. That asymmetry explains nearly every hard constraint in the spec — why the description has a length limit and the body does not, why the description must state trigger conditions rather than usage instructions.

Sign in and link WeChat to read

Sign in, then link your WeChat mini program account on the account page. Linked accounts share one free article per day. Unlock additional articles with rewarded videos in the mini program.

Mini program QR code

Scan in WeChat to open Dayward AI. Open the same course and chapter, choose the rewarded video, then refresh this page after completion.

Interview questions

  • If you implemented skill support in your own agent, what happens in the discovery stage versus the activation stage, and why split them?如果让你自己给一个 Agent 实现 skill 支持,发现阶段和激活阶段各要做什么?为什么要分成两步?
    Common in ChinaCommon overseasIntermediate#agent-skills#runtime#progressive-disclosure

    🔒 Unlock this chapter to see the answer keys.

  • When your runtime parses a SKILL.md that violates the spec, do you refuse to load it or degrade gracefully? And how do you handle a name collision across scopes?你的运行时解析到一份不合规范的 SKILL.md,是拒绝加载还是降级加载?另外,两个作用域里有同名 skill 时你怎么处理?
    Common in ChinaCommon overseasIntermediate#agent-skills#runtime#error-handling

    🔒 Unlock this chapter to see the answer keys.

  • Once a skill body is in context, how do you keep it effective across a long session? And would you activate skills by file read or by a dedicated tool?skill 的正文进了上下文之后,长会话里怎么保证它不失效?激活方式上文件读取和专用工具你会选哪个?
    Common in ChinaCommon overseasDeep dive#agent-skills#runtime#long-session

    🔒 Unlock this chapter to see the answer keys.

Comments