Skip to content

feat: Add an agent skill for working with setup chain#136

Merged
esatterwhite merged 3 commits into
mainfrom
esatterwhite/agent-skill
Jun 3, 2026
Merged

feat: Add an agent skill for working with setup chain#136
esatterwhite merged 3 commits into
mainfrom
esatterwhite/agent-skill

Conversation

@esatterwhite
Copy link
Copy Markdown
Member

@esatterwhite esatterwhite commented Jun 3, 2026

This adds a skill that confirms to the agentskills.io spec. It should work with most any agent provider. It can be discovered by the skills.sh cli

This includes instructions on adding actions and functions, as well as some guidence on general usage.

Resolves: #135

@esatterwhite esatterwhite force-pushed the esatterwhite/agent-skill branch from 794d0a3 to 3d6b11f Compare June 3, 2026 12:53
Comment thread skills/setup-chain/SKILL.md Outdated

## Custom Signatures (Advanced)

Only manually push `this.tasks` when action signature deviates from `(opts, label)`:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (opts, label) is the true default signature, perhaps the signature in number 1 should be (opts, _label) or (opts, label)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for number 1 - the label isn't passed to the actual action function, Thats only for defining the custom hook on the chain instance

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

async myAction(arg1, arg2) {

}

vs

class MyChain extends Chain {
  myAction(arg1, ar2, label) {
    this.tasks.push(['myAction', label, arg1, arg2])
  }
}

Comment thread skills/setup-chain/references/create-action.md
Comment thread skills/setup-chain/references/create-function.md
Comment thread skills/setup-chain/references/create-function.md Outdated
Comment thread skills/setup-chain/references/examples/lookups.js Outdated
- **Inside Action Options**:
You can pass function calls as values in action options; they will be resolved by the action's `this.lookup()` call.
```javascript
chain.myAction({ slug: '!slugify(#title)' })
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe say here that the results are in chain.state.myAction and say what the value is.

In fact, we don't really talk about how to use chain.state, but I use it often when I don't want to assign the .execute's return val to a variable. Not sure where that should go, but I think somewhere.

Copy link
Copy Markdown
Member Author

@esatterwhite esatterwhite Jun 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm. I have never used the internal state property directly. I tend to treat that as inside baseball / don't mess with it

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean you always do chain.lookup('myAction')?

Copy link
Copy Markdown
Member Author

@esatterwhite esatterwhite Jun 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, use lookup, or the return value from execute(), mostly the latter

Comment thread test/integration/actions/map.js Outdated
@esatterwhite esatterwhite force-pushed the esatterwhite/agent-skill branch 2 times, most recently from cbed2b2 to b43deae Compare June 3, 2026 16:02
@esatterwhite esatterwhite requested a review from darinspivey June 3, 2026 16:12
@esatterwhite
Copy link
Copy Markdown
Member Author

The build fail is an old npm token problem. looking at it

This adds a skill that confirms to the agentskills.io. It should work
with most any agent provider. It can be discovered by the skills.sh cli

This includes instructions on adding actions and functions, as well as
some guidence on general usage.

Resolves: #135
update the test matrix to include node 20, 22, 24
@esatterwhite esatterwhite force-pushed the esatterwhite/agent-skill branch from b43deae to f4aa522 Compare June 3, 2026 16:54
update eslint and bas config to latest version and corrects outstanding
linting errors
@esatterwhite esatterwhite force-pushed the esatterwhite/agent-skill branch from f4aa522 to 96cb56b Compare June 3, 2026 16:55
@esatterwhite esatterwhite merged commit b66c1d0 into main Jun 3, 2026
2 checks passed
@esatterwhite esatterwhite deleted the esatterwhite/agent-skill branch June 3, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an agent skill for using this library

2 participants