当前位置:首页 > 文章列表 > 文章 > 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基础的同学学习。
    543次学习
  • GO语言核心编程课程
    GO语言核心编程课程
    本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。
    516次学习
  • 简单聊聊mysql8与网络通信
    简单聊聊mysql8与网络通信
    如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让
    500次学习
  • JavaScript正则表达式基础与实战
    JavaScript正则表达式基础与实战
    在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。
    487次学习
  • 从零制作响应式网站—Grid布局
    从零制作响应式网站—Grid布局
    本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。
    485次学习
查看更多
AI推荐
  • ChatExcel酷表:告别Excel难题,北大团队AI助手助您轻松处理数据
    ChatExcel酷表
    ChatExcel酷表是由北京大学团队打造的Excel聊天机器人,用自然语言操控表格,简化数据处理,告别繁琐操作,提升工作效率!适用于学生、上班族及政府人员。
    3191次使用
  • Any绘本:开源免费AI绘本创作工具深度解析
    Any绘本
    探索Any绘本(anypicturebook.com/zh),一款开源免费的AI绘本创作工具,基于Google Gemini与Flux AI模型,让您轻松创作个性化绘本。适用于家庭、教育、创作等多种场景,零门槛,高自由度,技术透明,本地可控。
    3403次使用
  • 可赞AI:AI驱动办公可视化智能工具,一键高效生成文档图表脑图
    可赞AI
    可赞AI,AI驱动的办公可视化智能工具,助您轻松实现文本与可视化元素高效转化。无论是智能文档生成、多格式文本解析,还是一键生成专业图表、脑图、知识卡片,可赞AI都能让信息处理更清晰高效。覆盖数据汇报、会议纪要、内容营销等全场景,大幅提升办公效率,降低专业门槛,是您提升工作效率的得力助手。
    3434次使用
  • 星月写作:AI网文创作神器,助力爆款小说速成
    星月写作
    星月写作是国内首款聚焦中文网络小说创作的AI辅助工具,解决网文作者从构思到变现的全流程痛点。AI扫榜、专属模板、全链路适配,助力新人快速上手,资深作者效率倍增。
    4541次使用
  • MagicLight.ai:叙事驱动AI动画视频创作平台 | 高效生成专业级故事动画
    MagicLight
    MagicLight.ai是全球首款叙事驱动型AI动画视频创作平台,专注于解决从故事想法到完整动画的全流程痛点。它通过自研AI模型,保障角色、风格、场景高度一致性,让零动画经验者也能高效产出专业级叙事内容。广泛适用于独立创作者、动画工作室、教育机构及企业营销,助您轻松实现创意落地与商业化。
    3812次使用
微信登录更方便
  • 密码登录
  • 注册账号
登录即同意 用户协议隐私政策
返回登录
  • 重置密码