当前位置:首页 > 文章列表 > 文章 > python教程 > How to Create Custom Plans with “planmd” in Goose

How to Create Custom Plans with “planmd” in Goose

来源:dev.to 2024-11-29 19:13:08 0浏览 收藏

有志者,事竟成!如果你在学习文章,那么本文《How to Create Custom Plans with “planmd” in Goose》,就很适合你!文章讲解的知识点主要包括,若是你对本文感兴趣,或者是想搞懂其中某个知识点,就请你继续往下看吧~

How to Create Custom Plans with “planmd” in Goose

什么是鹅?
goose 是一种开发代理,可通过在终端或 ide 中自动执行编码任务来增强软件开发。在您输入的指导下,它会智能地分析您的项目需求,生成必要的代码,并自主实施更改。在与 goose 合作时,采用结构化方法来指导其执行以实现特定目标至关重要。这就是 plan.md 文件的用武之地。 plan.md 文件允许您为 goose 定义自定义计划,使用灵活的文本格式和 jinja 模板的强大功能来创建动态、可重用且面向目标的计划。

如何设置 goose
在创建自定义 plan.md 文件之前,您需要设置 goose。

第 1 步: 在 github 上分叉 goose 和 goose 插件存储库并克隆它们。

第2步:安装homebrew — 访问brew.sh并按照安装步骤操作,或运行:

/bin/bash -c "$(curl -fssl https://raw.githubusercontent.com/homebrew/install/head/install.sh)"

第 3 步: 要安装 goose,请使用 pipx。首先确保 pipx 已安装:

brew install pipx
pipx ensurepath

第四步:然后安装goose:

pipx install goose-ai

第 5 步: 启动会话 — 从您的终端导航到您要启动的目录并运行:

goose session start

goose 与您首选的法学硕士合作。默认情况下,它使用 openai 作为 llm 提供者。系统会提示您设置 api 密钥。

什么是“plan.md”文件?

plan.md 文件是一个文本文件,用作 goose 遵循的蓝图。它由两个基本组成部分组成:

a kickoff message that sets the context and overall goal
a structured list of tasks for goose to execute.

为什么使用 plan.md 文件?

  • 定制:
    您可以针对特定任务或项目定制 goose 的操作。

  • 可重复使用性:
    模板可以轻松地重复使用和修改类似目标的计划。

  • 清晰度:
    概述目标和步骤可确保更好的控制和可预测性。

创建您的第一个 plan.md 文件

假设您希望 goose 帮助建立一个新的设计系统。以下是您的 plan.md 的示例:

your goal is to set up a fresh design system for our app's redesign.

- create folders for design components (buttons, forms, colors)
- set up color palette based on brand guidelines
- create typography styles for headings and body text
- design basic button components with all states
- create form elements (inputs, dropdowns)

看到任务中每行开头的那些破折号 (-) 了吗?超级重要! goose 会寻找这些信息来了解需要采取哪些步骤。要使用此计划运行 goose:

goose session start --plan plan.md

在计划中使用 jinja 模板
jinja 是一个模板引擎,允许您直接在文本文件中嵌入变量、循环和条件。使用 jinja,您可以使 plan.md 文件变得动态且适应性强。

key jinja 语法

  • 变量: {{ 变量 }}

  • 循环: {% for item in list %}...{% endfor %}

  • 条件: {% if condition %}...{% endif %}

记住我们的 plan.md 文件,这是使用 jinja 模板的增强版本的样子。

# design system setup plan for {{ brand_name }}

## goal
set up a fresh design system for the {{ project_name }} app's redesign.

---

## steps to follow

### 1. create folders
organize design components into well-structured folders:
- **buttons:** include all button components and their states (default, hover, active, disabled).
- **forms:** include inputs, dropdowns, checkboxes, and radio buttons.
- **colors:** store primary, secondary, and accent color palettes.

### 2. set up color palette
define a consistent color palette adhering to the brand guidelines:
- **primary color:** {{ primary_color }} 
- **secondary color:** {{ secondary_color }}
- **accent colors:** {{ accent_colors | join(", ") }}
- **neutral colors:** add greys, whites, and blacks for backgrounds and borders.
- **accessibility:** ensure color contrast meets accessibility standards (wcag).

### 3. create typography styles
define text styles for the app:
- **headings:** {{ heading_styles | join(", ") }} 
- **body text:** include base styles, captions, and links.
- **font guidelines:** use {{ font_family }} with font sizes ranging from {{ font_sizes | join(", ") }}.

### 4. design button components
design the following button states:
- default
- hover
- active
- disabled

ensure all buttons are:
- **responsive:** scalable across device sizes.
- **accessible:** incorporate clear focus states for keyboard navigation.

### 5. create form elements
design essential form components:
- input fields (default, focused, error)
- dropdowns (expanded, collapsed)
- checkboxes and radio buttons (checked, unchecked, disabled)
- submit buttons (loading, error)

---

## additional notes
- test designs for usability and accessibility before finalizing.

将参数传递给计划
执行期间可以将参数传递到 plan.md 文件中。例如,为了使我们的设计系统设置计划动态且可重用,我们使用 jinja 模板,它允许我们传递根据特定项目、品牌或设计要求定制内容的参数。通过传递不同的参数集,我们可以轻松地为任何重新设计或产品生成个性化计划。

示例:与 jinja 传递参数

定义数据:第一步是准备要传递到模板中的数据。这包括品牌名称、颜色、排版风格和其他设计特定细节等值。

{
    "brand_name": "awesomeapp",
    "project_name": "awesomeapp redesign",
    "primary_color": "#3498db",
    "secondary_color": "#2ecc71",
    "accent_colors": ["#e74c3c", "#9b59b6", "#f1c40f"],
    "heading_styles": ["h1 (32px)", "h2 (24px)", "h3 (20px)"],
    "font_family": "roboto, sans-serif",
    "font_sizes": ["12px", "14px", "16px", "18px", "24px", "32px"],
}

要使用此计划和参数运行 goose,您将运行以下命令:

goose session start --plan plan.md --args brand_name=awesomeapp,project_name="awesomeapp redesign",primary_color="#3498db",secondary_color="#2ecc71",accent_colors="#e74c3c,#9b59b6,#f1c40f",heading_styles="h1 (32px),h2 (24px),h3 (20px)",font_family="roboto, sans-serif",font_sizes="12px,14px,16px,18px,24px,32px"

goose 将使用这些值填充 plan.md 中的占位符。

# Design System Setup Plan for AwesomeApp

## Goal
Set up a fresh design system for the AwesomeApp Redesign app's redesign.

---

## Steps to Follow

### 1. Create Folders
Organize design components into well-structured folders:
- **Buttons:** Include all button components and their states (default, hover, active, disabled).
- **Forms:** Include inputs, dropdowns, checkboxes, and radio buttons.
- **Colors:** Store primary, secondary, and accent color palettes.

### 2. Set Up Color Palette
Define a consistent color palette adhering to the brand guidelines:
- **Primary Color:** #3498db
- **Secondary Color:** #2ecc71
- **Accent Colors:** #e74c3c, #9b59b6, #f1c40f
- **Neutral Colors:** Add greys, whites, and blacks for backgrounds and borders.
- **Accessibility:** Ensure color contrast meets accessibility standards (WCAG).

### 3. Create Typography Styles
Define text styles for the app:
- **Headings:** 
  - H1 (32px)
  - H2 (24px)
  - H3 (20px)
- **Font Family:** Roboto, sans-serif
- **Font Sizes:** 
  - 12px
  - 14px
  - 16px
  - 18px
  - 24px
  - 32px

### 4. Design Button Components
Design the following button states:
- Default
- Hover
- Active
- Disabled

Ensure all buttons are:
- **Responsive:** Scalable across device sizes.
- **Accessible:** Incorporate clear focus states for keyboard navigation.

### 5. Create Form Elements
Design essential form components:
- Input Fields (default, focused, error)
- Dropdowns (expanded, collapsed)
- Checkboxes and Radio Buttons (checked, unchecked, disabled)
- Submit Buttons (loading, error)

---

## Additional Notes
- Test designs for usability and accessibility before finalizing.

最佳实践和提示

  • 定义明确的目标:确保每个计划都以明确的目标开始。
  • 使用可重用模板:创建可以针对不同项目自定义的通用模板。
  • 文档假设:添加注释或注释来解释占位符和结构。
  • 测试小更改:验证 plan.md 文件中的每个更改以确保正确渲染。

结论
plan.md 文件是一个多功能工具,用于指导 goose 的执行以实现您的目标。通过结合明确的目标、结构化的步骤和动态 jinja 模板,您可以创建可重用且高度可定制的计划。无论您是要改进移动应用程序的用户体验还是处理复杂的项目,plan.md 都可以帮助您为 goose 提供清晰度、适应性和精确性。

文中关于的知识介绍,希望对你的学习有所帮助!若是受益匪浅,那就动动鼠标收藏这篇《How to Create Custom Plans with “planmd” in Goose》文章吧,也可关注golang学习网公众号了解相关技术文章。

版本声明
本文转载于:dev.to 如有侵犯,请联系study_golang@163.com删除
如何获取 MySQL 实例的 Binlog 文件和偏移量并停止 Slave 状态?如何获取 MySQL 实例的 Binlog 文件和偏移量并停止 Slave 状态?
上一篇
如何获取 MySQL 实例的 Binlog 文件和偏移量并停止 Slave 状态?
JavaScript 是同步还是异步,是单线程还是多线程? JavaScript代码是如何执行的?
下一篇
JavaScript 是同步还是异步,是单线程还是多线程? JavaScript代码是如何执行的?
查看更多
最新文章
查看更多
课程推荐
  • 前端进阶之JavaScript设计模式
    前端进阶之JavaScript设计模式
    设计模式是开发人员在软件开发过程中面临一般问题时的解决方案,代表了最佳的实践。本课程的主打内容包括JS常见设计模式以及具体应用场景,打造一站式知识长龙服务,适合有JS基础的同学学习。
    542次学习
  • GO语言核心编程课程
    GO语言核心编程课程
    本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。
    508次学习
  • 简单聊聊mysql8与网络通信
    简单聊聊mysql8与网络通信
    如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让
    497次学习
  • JavaScript正则表达式基础与实战
    JavaScript正则表达式基础与实战
    在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。
    487次学习
  • 从零制作响应式网站—Grid布局
    从零制作响应式网站—Grid布局
    本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。
    484次学习
查看更多
AI推荐
  • 茅茅虫AIGC检测:精准识别AI生成内容,保障学术诚信
    茅茅虫AIGC检测
    茅茅虫AIGC检测,湖南茅茅虫科技有限公司倾力打造,运用NLP技术精准识别AI生成文本,提供论文、专著等学术文本的AIGC检测服务。支持多种格式,生成可视化报告,保障您的学术诚信和内容质量。
    90次使用
  • 赛林匹克平台:科技赛事聚合,赋能AI、算力、量子计算创新
    赛林匹克平台(Challympics)
    探索赛林匹克平台Challympics,一个聚焦人工智能、算力算法、量子计算等前沿技术的赛事聚合平台。连接产学研用,助力科技创新与产业升级。
    98次使用
  • SEO  笔格AIPPT:AI智能PPT制作,免费生成,高效演示
    笔格AIPPT
    SEO 笔格AIPPT是135编辑器推出的AI智能PPT制作平台,依托DeepSeek大模型,实现智能大纲生成、一键PPT生成、AI文字优化、图像生成等功能。免费试用,提升PPT制作效率,适用于商务演示、教育培训等多种场景。
    100次使用
  • 稿定PPT:在线AI演示设计,高效PPT制作工具
    稿定PPT
    告别PPT制作难题!稿定PPT提供海量模板、AI智能生成、在线协作,助您轻松制作专业演示文稿。职场办公、教育学习、企业服务全覆盖,降本增效,释放创意!
    97次使用
  • Suno苏诺中文版:AI音乐创作平台,人人都是音乐家
    Suno苏诺中文版
    探索Suno苏诺中文版,一款颠覆传统音乐创作的AI平台。无需专业技能,轻松创作个性化音乐。智能词曲生成、风格迁移、海量音效,释放您的音乐灵感!
    94次使用
微信登录更方便
  • 密码登录
  • 注册账号
登录即同意 用户协议隐私政策
返回登录
  • 重置密码