원클릭으로
setup-chain
create new actions, functions or workflows for logdna/setup-chain
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
create new actions, functions or workflows for logdna/setup-chain
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | setup-chain |
| description | create new actions, functions or workflows for logdna/setup-chain |
| license | MIT |
| metadata | {"author":"Mezmo Inc,."} |
Adds new actions and functions to logdna setup-chain
node executable is installed on the host@logdna/setup-chain in dependencies or devDependenciesIf any of the above are not met, explain what is missing. Do not proceed with custom action creation.
Follow these steps to create and wire up a custom action:
Define the action function in an actions object
async functions or return a Promiseconst actions = {
myAction: async (opts) => {
return opts.value || 'default'
}
}
Create or extend SetupChain class
class MyChain extends SetupChain {
constructor(state) {
super(state, actions)
}
}
Use the action in your chain
await new MyChain().myAction({value: 'test'}, 'result').execute()
// state: {result: 'test'}
Validate your implementation works as expected
Only manually push this.tasks when action signature deviates from (opts, label):
class MyChain extends SetupChain {
constructor(state) {
super(state, yourActions)
}
customAction(arg1, arg2, label) {
this.tasks.push(['customAction', label, arg1, arg2])
return this
}
}
See create-action.md for detailed patterns and examples.
SetupChain implements chain-of-responsibility pattern. Actions are available as top level functions on a chain instance. Chain actions, execute, and results are stored in state.
const chain = new MyChain()
const state = await chain
.set('user', 'alice')
.map('#user', n => n * 2, 'doubled')
.execute()
// state: {user: 'alice', doubled: [2, 4, 6]}
Best practices:
.action1().action2().execute()new SetupChain(state2)const chain = new MyChain()
// test scenerio 1
chain
.account({}, 'account_one')
.user({account: '#account_one'}, 'user_one')
// test scenerio 1
chain
.account({}, 'account_two')
.user({account: '#account_two'}, 'user_two')
const state = await chain.execute()