Enforces declarative programming style: decompose every meaningful procedure into named functions so calling code reads as a sequence of intentions, not inline logic blocks.
Declarative programming via decomposition: Every meaningful procedure MUST be extracted into its own named function. The calling code should declare what happens -- a sequence of clearly-named steps -- not contain inline how logic.
A comment that labels a block of code (e.g., # validate input,
// calculate totals) is a signal the block should be a named function instead.
def process_order(order):
validated = validate_order(order)
priced = calculate_pricing(validated)
receipt = charge_payment(priced)
send_confirmation(receipt)
The top-level function reads as a sequence of intentions. Each step is a named function whose implementation lives elsewhere.
def process_order(order):
# validate
if not order.items:
raise ValueError("Empty")
for item in order.items:
if item.qty < 1:
raise ValueError("Bad qty")
# calculate pricing
subtotal = sum(i.price * i.qty for i in order.items)
tax = subtotal * 0.1
total = subtotal + tax
# charge
resp = payment_api.charge(order.card, total)
if resp.status != 'ok':
raise PaymentError(resp.msg)
# send confirmation
email_service.send(to=order.email, subject='Order confirmed', body=f'Total: {total}')
The comment headers (# validate, # calculate pricing, etc.) are signals that
each block should be extracted into a named function.
npx skills add yotto3s/declarative-programming下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer