当前位置:首页 > 文章列表 > 文章 > 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推荐
  • AI Make Song:零门槛AI音乐创作平台,助你轻松制作个性化音乐
    AI Make Song
    AI Make Song是一款革命性的AI音乐生成平台,提供文本和歌词转音乐的双模式输入,支持多语言及商业友好版权体系。无论你是音乐爱好者、内容创作者还是广告从业者,都能在这里实现“用文字创造音乐”的梦想。平台已生成超百万首原创音乐,覆盖全球20个国家,用户满意度高达95%。
    17次使用
  • SongGenerator.io:零门槛AI音乐生成器,快速创作高质量音乐
    SongGenerator
    探索SongGenerator.io,零门槛、全免费的AI音乐生成器。无需注册,通过简单文本输入即可生成多风格音乐,适用于内容创作者、音乐爱好者和教育工作者。日均生成量超10万次,全球50国家用户信赖。
    13次使用
  •  BeArt AI换脸:免费在线工具,轻松实现照片、视频、GIF换脸
    BeArt AI换脸
    探索BeArt AI换脸工具,免费在线使用,无需下载软件,即可对照片、视频和GIF进行高质量换脸。体验快速、流畅、无水印的换脸效果,适用于娱乐创作、影视制作、广告营销等多种场景。
    13次使用
  • SEO标题协启动:AI驱动的智能对话与内容生成平台 - 提升创作效率
    协启动
    SEO摘要协启动(XieQiDong Chatbot)是由深圳协启动传媒有限公司运营的AI智能服务平台,提供多模型支持的对话服务、文档处理和图像生成工具,旨在提升用户内容创作与信息处理效率。平台支持订阅制付费,适合个人及企业用户,满足日常聊天、文案生成、学习辅助等需求。
    16次使用
  • Brev AI:零注册门槛的全功能免费AI音乐创作平台
    Brev AI
    探索Brev AI,一个无需注册即可免费使用的AI音乐创作平台,提供多功能工具如音乐生成、去人声、歌词创作等,适用于内容创作、商业配乐和个人创作,满足您的音乐需求。
    18次使用
微信登录更方便
  • 密码登录
  • 注册账号
登录即同意 用户协议隐私政策
返回登录
  • 重置密码