You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- replaced *.hbs with *.md for actions code syntax highlighting
- added support for ':pre' template execution code script blocks
- added input text classification into a suitable action template
- added support for running nodejs pre code blocks and returning data chaining between code blocks
- added 2/3 functioning write-readme action
Copy file name to clipboardexpand all lines: actions/create-react-website.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,17 @@
2
2
Creates a reactJS webapp project.
3
3
```
4
4
5
-
```pre:js
5
+
```js:pre
6
6
// javascript code to run on project before executing the template prompt
7
7
// contains a 'context' object with the keys:
8
8
// 'input' = user input text prompt
9
9
// if you want, you may return an object to make the values available for the next code-block or template
10
10
// this codeblock gets executed isolated within an async function
11
+
// you can also use any of the variables available on the handlebar template such as source_tree, absolute_code_path, etc
11
12
// you also have some methods for asking info to the user like (await prompt)
12
13
// anything queried to the user is translated to the user's language using the LLM
13
14
const project_name = await prompt('What is the name of your project?')
14
-
const app_name = await queryLLM('Create a short folder name (max 10 chars without spaces) for the following text: ' + project_name,
15
+
const app_name = await queryLLM('Create a short but meaningful folder name (between 8-12 chars, dash-case, lowercase) extracted from the following text: ' + project_name,
15
16
z.object({
16
17
name: z.string().describe('the reactjs folder name for the text'),
17
18
})
@@ -21,7 +22,7 @@ return {
21
22
}
22
23
```
23
24
24
-
```pre:bash
25
+
```bash:pre
25
26
# terminal commands to run on project before executing the template prompt
26
27
# if OS is different than MacOS we could ask the LLM for translating them to another OS later before execution
27
28
# any bash here executes with the env CI=true so it won't prompt the user for anything
Copy file name to clipboardexpand all lines: actions/write-readme.md
+34-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,39 @@
1
1
```description
2
2
Generates a README file for a project.
3
3
```
4
+
5
+
```js:pre
6
+
// what kind of files should I read from this project source to generate the README?
7
+
const files_ = await queryLLM('What are the main files we need from the sourcetree to generate a README of this project?\n'+source_tree,
8
+
z.array(z.string()).describe('filenames to read from the given source tree')
9
+
);
10
+
console.log('queryLLM files_',files_.data);
11
+
// read the indicated files and return object overwriting default files (use readFiles helper that takes an array of files and returns an array of objects with a field named 'code')
12
+
// add absolute_code_path prefix to the files if it's not contained
13
+
// filter 'files' to only include the files that are in the 'files_' array
14
+
let filtered = [];
15
+
files = files.map((item)=>{
16
+
files_.data.some((file)=>{
17
+
if (item.path.includes(file)){
18
+
// also truncate the files to 1000 characters
19
+
item.code = item.code.substring(0, 1000);
20
+
filtered.push(item);
21
+
return true;
22
+
}
23
+
});
24
+
});
25
+
console.log('filtered', filtered);
26
+
console.log('files_', files_);
27
+
return {
28
+
files: filtered
29
+
}
30
+
```
31
+
32
+
```js:pre
33
+
console.log('SECOND JS BLOCK');
34
+
console.log('files2', files);
35
+
```
36
+
4
37
Project Path: {{ absolute_code_path }}
5
38
6
39
I'd like you to generate a high-quality README file for this project, suitable for hosting on GitHub. Analyze the codebase to understand the purpose, functionality, and structure of the project.
@@ -36,7 +69,7 @@ Write the content in Markdown format. Use your analysis of the code to generate
36
69
37
70
Feel free to infer reasonable details if needed, but try to stick to what can be determined from the codebase itself. Let me know if you have any other questions as you're writing!
0 commit comments