@robot-inventor/agent-skills 0.0.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,45 +1,45 @@
1
- ---
2
- name: review-loop
3
- description: Thoroughly improve code quality by requesting a review from a sub-agent after completing tasks requiring code editing, before returning the conversation turn to the user. Use for any task that edits code or configuration. Read this skill before starting edits, and after completing the requested changes run an isolated sub-agent review loop before returning the final response.
4
- license: MIT
5
- metadata:
6
- author: Robot-Inventor
7
- ---
8
-
9
- # Review Loop Skill
10
-
11
- This skill involves thoroughly improving code quality by repeatedly requesting a review from a sub-agent after editing and improving the code based on the results. Humans typically improve code quality by creating a pull request after editing code and having it reviewed by a reviewer. Such reviews are important because they can identify problems that might be missed through self-review alone.
12
-
13
- ## When to apply
14
-
15
- Apply this skill in the following situations:
16
-
17
- - When you have performed a task that requires code editing, and
18
- - After completing the task instructed by the user, and
19
- - Before returning the conversation to the user
20
-
21
- ## Steps
22
-
23
- The following is the core of this skill; please follow the specified steps.
24
-
25
- ### 1. Request a code review
26
-
27
- Request a code review from the subagent.
28
-
29
- If you have the option to choose whether to fork the context or launch the subagent in an isolated context when starting it, **always** launch it in an isolated context. Forking the context would be equivalent to a self-review, so you need to launch a subagent in an isolated context to review it from a different perspective.
30
-
31
- When requesting a review from a sub-agent, be sure to provide them with an overview of the task requested by the user, and instruct them to thoroughly review the changes made to the current workspace.
32
-
33
- ### 2. Receive reviews and improve your code
34
-
35
- Once you receive the review results from the sub-agent, consider whether each point is valid. You may ignore clearly unreasonable points, but you must address valid points and correct the code accordingly.
36
-
37
- In particular, if you receive feedback on a part that doesn't strictly follow the user's instructions as a result of compromises, do not ignore it. Instead, correct it according to the review to align with the user's instructions as much as possible. If you absolutely cannot comply with the user's request, you may ignore the sub-agent's point about that part, but be sure to inform the user of the compromise you made when you return the conversation to them.
38
-
39
- ### 3. Review loop
40
-
41
- After addressing valid feedback from the subagent, repeat steps 1 and 2 ("1. Request a code review" and "2. Receive reviews and improve your code") until there is no more valid feedback from the subagent, thoroughly improving your code quality. In this review loop, always have a new subagent review your code each time.
42
-
43
- ### 4. Report the results to the user
44
-
45
- Once the review loop is complete, return the conversation to the user. Be sure to honestly report to the user any points where you had to compromise and did not strictly follow their instructions.
1
+ ---
2
+ name: review-loop
3
+ description: Thoroughly improve code quality by requesting a review from a sub-agent after completing tasks requiring code editing, before returning the conversation turn to the user. Use for any task that edits code or configuration. Read this skill before starting edits, and after completing the requested changes run an isolated sub-agent review loop before returning the final response.
4
+ license: MIT
5
+ metadata:
6
+ author: Robot-Inventor
7
+ ---
8
+
9
+ # Review Loop Skill
10
+
11
+ This skill involves thoroughly improving code quality by repeatedly requesting a review from a sub-agent after editing and improving the code based on the results. Humans typically improve code quality by creating a pull request after editing code and having it reviewed by a reviewer. Such reviews are important because they can identify problems that might be missed through self-review alone.
12
+
13
+ ## When to apply
14
+
15
+ Apply this skill in the following situations:
16
+
17
+ - When you have performed a task that requires code editing, and
18
+ - After completing the task instructed by the user, and
19
+ - Before returning the conversation to the user
20
+
21
+ ## Steps
22
+
23
+ The following is the core of this skill; please follow the specified steps.
24
+
25
+ ### 1. Request a code review
26
+
27
+ Request a code review from the subagent.
28
+
29
+ If you have the option to choose whether to fork the context or launch the subagent in an isolated context when starting it, **always** launch it in an isolated context. Forking the context would be equivalent to a self-review, so you need to launch a subagent in an isolated context to review it from a different perspective.
30
+
31
+ When requesting a review from a sub-agent, be sure to provide them with an overview of the task requested by the user, and instruct them to thoroughly review the changes made to the current workspace.
32
+
33
+ ### 2. Receive reviews and improve your code
34
+
35
+ Once you receive the review results from the sub-agent, consider whether each point is valid. You may ignore clearly unreasonable points, but you must address valid points and correct the code accordingly.
36
+
37
+ In particular, if you receive feedback on a part that doesn't strictly follow the user's instructions as a result of compromises, do not ignore it. Instead, correct it according to the review to align with the user's instructions as much as possible. If you absolutely cannot comply with the user's request, you may ignore the sub-agent's point about that part, but be sure to inform the user of the compromise you made when you return the conversation to them.
38
+
39
+ ### 3. Review loop
40
+
41
+ After addressing valid feedback from the subagent, repeat steps 1 and 2 ("1. Request a code review" and "2. Receive reviews and improve your code") until there is no more valid feedback from the subagent, thoroughly improving your code quality. In this review loop, always have a new subagent review your code each time.
42
+
43
+ ### 4. Report the results to the user
44
+
45
+ Once the review loop is complete, return the conversation to the user. Be sure to honestly report to the user any points where you had to compromise and did not strictly follow their instructions.
@@ -1,27 +1,27 @@
1
- ---
2
- name: simple-engineering
3
- description: A skill outlining the fundamental principles to keep in mind when writing or editing code. Read this skill before developing an implementation plan or writing or reviewing code, and apply it to your work.
4
- license: MIT
5
- metadata:
6
- author: Robot-Inventor
7
- ---
8
-
9
- # Simple Engineering
10
-
11
- ## Keep it simple and elegant
12
-
13
- Overengineering is a shameful and foolish act, and it is important to always pursue simple and elegant solutions.
14
-
15
- Before implementing a feature or fixing a bug, consider all options. Instead of just listing similar choices or being bound by preconceptions and previous thinking, consider all options, including completely different approaches. Among the available options, choose the one that is the clearest, simplest, requires the fewest lines of code, and meets the user's requirements. There is no need to use iron plates and nails to repair torn clothes. Choose a right-sized, simple approach rather than an overly large and complex one.
16
-
17
- Also avoid bringing unnecessary complexity into your code. Carefully examine related processing to ensure there are no impossible conditional branches or unnecessary try-catch blocks. Check the type definitions and actual processing, and remove any impossible conditional branches. There is no need to wrap code in a new try-catch block if an exception is unlikely to occur normally or if a try-catch already exists inside the called function.
18
-
19
- ## Avoid reinventing the wheel
20
-
21
- Reinventing the wheel should be avoided. Before adding code, check whether existing code in the project or the project's dependencies already provide functionality that covers part or all of that processing. When implementing complex processing, investigate whether a popular and well-maintained library that achieves equivalent functionality exists, and if so, propose using it to the user.
22
-
23
- ## Keep only necessary changes
24
-
25
- Keep the YAGNI (You aren't gonna need it) principle in mind. You should not introduce complexity just because you might need it in the future. Also, there is no need to maintain backward compatibility for unreleased features.
26
-
27
- The code ultimately delivered to the user should be such that every line of change is necessary and no unnecessary code remains. Carefully review the diff line by line, rather than file by file, to ensure that all changes are truly necessary.
1
+ ---
2
+ name: simple-engineering
3
+ description: A skill outlining the fundamental principles to keep in mind when writing or editing code. Read this skill before developing an implementation plan or writing or reviewing code, and apply it to your work.
4
+ license: MIT
5
+ metadata:
6
+ author: Robot-Inventor
7
+ ---
8
+
9
+ # Simple Engineering
10
+
11
+ ## Keep it simple and elegant
12
+
13
+ Overengineering is a shameful and foolish act, and it is important to always pursue simple and elegant solutions.
14
+
15
+ Before implementing a feature or fixing a bug, consider all options. Instead of just listing similar choices or being bound by preconceptions and previous thinking, consider all options, including completely different approaches. Among the available options, choose the one that is the clearest, simplest, requires the fewest lines of code, and meets the user's requirements. There is no need to use iron plates and nails to repair torn clothes. Choose a right-sized, simple approach rather than an overly large and complex one.
16
+
17
+ Also avoid bringing unnecessary complexity into your code. Carefully examine related processing to ensure there are no impossible conditional branches or unnecessary try-catch blocks. Check the type definitions and actual processing, and remove any impossible conditional branches. There is no need to wrap code in a new try-catch block if an exception is unlikely to occur normally or if a try-catch already exists inside the called function.
18
+
19
+ ## Avoid reinventing the wheel
20
+
21
+ Reinventing the wheel should be avoided. Before adding code, check whether existing code in the project or the project's dependencies already provide functionality that covers part or all of that processing. When implementing complex processing, investigate whether a popular and well-maintained library that achieves equivalent functionality exists, and if so, propose using it to the user.
22
+
23
+ ## Keep only necessary changes
24
+
25
+ Keep the YAGNI (You aren't gonna need it) principle in mind. You should not introduce complexity just because you might need it in the future. Also, there is no need to maintain backward compatibility for unreleased features.
26
+
27
+ The code ultimately delivered to the user should be such that every line of change is necessary and no unnecessary code remains. Carefully review the diff line by line, rather than file by file, to ensure that all changes are truly necessary.
@@ -1,109 +1,109 @@
1
- ---
2
- name: web-master
3
- description: A skill outlining the fundamental principles to keep in mind when writing or editing web-related code. Read this skill before developing an implementation plan or writing or reviewing code for web-related tasks, and apply it to your work.
4
- license: MIT
5
- metadata:
6
- author: Robot-Inventor
7
- ---
8
-
9
- # Web Master
10
-
11
- Follow these instructions when writing web-related code.
12
-
13
- ## TypeScript
14
-
15
- ### Do not use type assertions
16
-
17
- Do not reach for type assertions unless you need one. Never add a type assertion up front because you think you might need it later. You may use a type assertion only when all of these conditions apply:
18
-
19
- - You first write the code without a type assertion and encounter a type error.
20
- - You cannot resolve that type error by improving type definitions elsewhere.
21
- - Adding the type assertion does not compromise type safety.
22
-
23
- ### Do not use `ReturnType`
24
-
25
- Do not use `ReturnType` unless you need it. Use the following approaches instead.
26
-
27
- If you need to use the return type of a specific function defined in the project somewhere other than that function:
28
-
29
- - For a simple primitive type such as `boolean` or `string`, write the type directly.
30
- - For a complex type, define a named type, specify it as the function's return type (`(): T => {}`), and reuse `T`.
31
-
32
- If you need the return type of a library function:
33
-
34
- - Check the function's type definitions first.
35
- - If the library exports that type, use the exported type.
36
- - If you need to pass the return type of another library function as a type argument and the library does not export that function's return type, you may use `ReturnType` inside the type argument.
37
- - If the library does not export the type:
38
- - Write the type directly if it is a simple primitive type.
39
- - Otherwise, you may use `ReturnType`.
40
-
41
- ```ts
42
- // Incorrect
43
- import foo from "foo";
44
-
45
- const myFunc = (): string => {...};
46
-
47
- const myFunc2 = (arg: ReturnType<typeof foo>, arg2: ReturnType<typeof myFunc>): number => {...};
48
-
49
- // Correct
50
- import type { FooResult } from "foo";
51
-
52
- const myFunc = (): string => {...};
53
-
54
- const myFunc2 = (arg: FooResult, arg2: string): number => {...};
55
- ```
56
-
57
- ### Prefer `as const satisfies` over type annotations
58
-
59
- Do not add type annotations unless you need them. Start by writing the code without a type annotation. If that causes a type error, first try to resolve it by improving type definitions elsewhere. Use a type annotation only as a last resort when those changes cannot solve the problem.
60
-
61
- When you write an object and need to guarantee that it conforms to a specific type, use `satisfies`. If the object will not change, also use `as const`.
62
-
63
- ```ts
64
- // Incorrect
65
- const foo: Record<string, string> = {
66
- bar: "bar",
67
- };
68
-
69
- // Correct
70
- const foo = {
71
- bar: "bar",
72
- } as const satisfies T;
73
- ```
74
-
75
- ### Do not disable ESLint rules
76
-
77
- Do not disable ESLint rules as an easy workaround. ESLint errors usually identify low-quality code rather than create pointless obstacles. Disabling a rule to silence an error leaves the underlying problem in place.
78
-
79
- Disable an ESLint rule only as a last resort when no better option exists. Handle ESLint errors as follows:
80
-
81
- 1. Understand what ESLint is reporting. Identify the affected code and the purpose behind the rule.
82
- 2. Improve the code in a way that addresses that purpose.
83
- 3. Disable the rule only when complying with it would make the code **excessively** complex, the warning is a clear false positive, you have another legitimate reason to disable it, or a possible fix would conflict with the rule's underlying intent.
84
-
85
- #### Examples
86
-
87
- The ESLint `sort-imports` rule defines a consistent import order. In properly modularized code, behavior should not depend on import order, so you should follow the rule.
88
-
89
- ```ts
90
- // Incorrect
91
- /* eslint-disable sort-imports */
92
- import foo from "foo";
93
- import bar from "bar";
94
-
95
- // Correct
96
- import bar from "bar";
97
- import foo from "foo";
98
- ```
99
-
100
- The `no-magic-numbers` rule exists to give numeric values meaningful names when their purpose would otherwise be unclear. You do not need to force an obvious value, such as `60` when it represents the number of seconds in a minute, into a constant just to satisfy the rule. In that case, disabling the rule is acceptable. Replacing `1` with a constant named `ONE` also defeats the purpose of `no-magic-numbers`. Give the value a meaningful name instead, or disable the rule if its meaning is already obvious. Also consider whether the number needs to be hard-coded in the first place.
101
-
102
- ```ts
103
- // Incorrect
104
- // eslint-disable-next-line no-magic-numbers
105
- if (myArray.length !== 0) {...}
106
-
107
- // Correct
108
- if (myArray.length) {...}
109
- ```
1
+ ---
2
+ name: web-master
3
+ description: A skill outlining the fundamental principles to keep in mind when writing or editing web-related code. Read this skill before developing an implementation plan or writing or reviewing code for web-related tasks, and apply it to your work.
4
+ license: MIT
5
+ metadata:
6
+ author: Robot-Inventor
7
+ ---
8
+
9
+ # Web Master
10
+
11
+ Follow these instructions when writing web-related code.
12
+
13
+ ## TypeScript
14
+
15
+ ### Do not use type assertions
16
+
17
+ Do not reach for type assertions unless you need one. Never add a type assertion up front because you think you might need it later. You may use a type assertion only when all of these conditions apply:
18
+
19
+ - You first write the code without a type assertion and encounter a type error.
20
+ - You cannot resolve that type error by improving type definitions elsewhere.
21
+ - Adding the type assertion does not compromise type safety.
22
+
23
+ ### Do not use `ReturnType`
24
+
25
+ Do not use `ReturnType` unless you need it. Use the following approaches instead.
26
+
27
+ If you need to use the return type of a specific function defined in the project somewhere other than that function:
28
+
29
+ - For a simple primitive type such as `boolean` or `string`, write the type directly.
30
+ - For a complex type, define a named type, specify it as the function's return type (`(): T => {}`), and reuse `T`.
31
+
32
+ If you need the return type of a library function:
33
+
34
+ - Check the function's type definitions first.
35
+ - If the library exports that type, use the exported type.
36
+ - If you need to pass the return type of another library function as a type argument and the library does not export that function's return type, you may use `ReturnType` inside the type argument.
37
+ - If the library does not export the type:
38
+ - Write the type directly if it is a simple primitive type.
39
+ - Otherwise, you may use `ReturnType`.
40
+
41
+ ```ts
42
+ // Incorrect
43
+ import foo from "foo";
44
+
45
+ const myFunc = (): string => {...};
46
+
47
+ const myFunc2 = (arg: ReturnType<typeof foo>, arg2: ReturnType<typeof myFunc>): number => {...};
48
+
49
+ // Correct
50
+ import type { FooResult } from "foo";
51
+
52
+ const myFunc = (): string => {...};
53
+
54
+ const myFunc2 = (arg: FooResult, arg2: string): number => {...};
55
+ ```
56
+
57
+ ### Prefer `as const satisfies` over type annotations
58
+
59
+ Do not add type annotations unless you need them. Start by writing the code without a type annotation. If that causes a type error, first try to resolve it by improving type definitions elsewhere. Use a type annotation only as a last resort when those changes cannot solve the problem.
60
+
61
+ When you write an object and need to guarantee that it conforms to a specific type, use `satisfies`. If the object will not change, also use `as const`.
62
+
63
+ ```ts
64
+ // Incorrect
65
+ const foo: Record<string, string> = {
66
+ bar: "bar",
67
+ };
68
+
69
+ // Correct
70
+ const foo = {
71
+ bar: "bar",
72
+ } as const satisfies T;
73
+ ```
74
+
75
+ ### Do not disable ESLint rules
76
+
77
+ Do not disable ESLint rules as an easy workaround. ESLint errors usually identify low-quality code rather than create pointless obstacles. Disabling a rule to silence an error leaves the underlying problem in place.
78
+
79
+ Disable an ESLint rule only as a last resort when no better option exists. Handle ESLint errors as follows:
80
+
81
+ 1. Understand what ESLint is reporting. Identify the affected code and the purpose behind the rule.
82
+ 2. Improve the code in a way that addresses that purpose.
83
+ 3. Disable the rule only when complying with it would make the code **excessively** complex, the warning is a clear false positive, you have another legitimate reason to disable it, or a possible fix would conflict with the rule's underlying intent.
84
+
85
+ #### Examples
86
+
87
+ The ESLint `sort-imports` rule defines a consistent import order. In properly modularized code, behavior should not depend on import order, so you should follow the rule.
88
+
89
+ ```ts
90
+ // Incorrect
91
+ /* eslint-disable sort-imports */
92
+ import foo from "foo";
93
+ import bar from "bar";
94
+
95
+ // Correct
96
+ import bar from "bar";
97
+ import foo from "foo";
98
+ ```
99
+
100
+ The `no-magic-numbers` rule exists to give numeric values meaningful names when their purpose would otherwise be unclear. You do not need to force an obvious value, such as `60` when it represents the number of seconds in a minute, into a constant just to satisfy the rule. In that case, disabling the rule is acceptable. Replacing `1` with a constant named `ONE` also defeats the purpose of `no-magic-numbers`. Give the value a meaningful name instead, or disable the rule if its meaning is already obvious. Also consider whether the number needs to be hard-coded in the first place.
101
+
102
+ ```ts
103
+ // Incorrect
104
+ // eslint-disable-next-line no-magic-numbers
105
+ if (myArray.length !== 0) {...}
106
+
107
+ // Correct
108
+ if (myArray.length) {...}
109
+ ```