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
Copy file name to clipboardExpand all lines: docs/WORKFLOWS.md
+52-9Lines changed: 52 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Automated Workflows
2
2
3
-
Codekin includes an automated workflow system that runs Claude Code sessions on a schedule to produce structured reports — code reviews, security audits, coverage assessments, and more. Workflows are defined as Markdown files with YAML frontmatter.
3
+
Codekin includes an automated workflow system that runs Claude Code sessions on a schedule to produce structured reports — code reviews, security audits, coverage assessments, and more. Workflows are defined as Markdown files with YAML frontmatter. Codekin ships with six built-in workflows, and you can define your own custom workflows per-repo.
4
4
5
5
---
6
6
@@ -77,34 +77,77 @@ All built-in workflows are loaded automatically at server start.
77
77
78
78
---
79
79
80
-
## Per-Repo Prompt Overrides
80
+
## Custom Repo Workflows
81
81
82
-
You can override the prompt for any workflow kind on a per-repository basis without modifying the built-in definitions. Create a file at:
82
+
You can define your own workflow types on a per-repository basis — no changes to Codekin itself are needed. Place `.md` workflow files at:
83
83
84
84
```
85
85
{repoPath}/.codekin/workflows/{kind}.md
86
86
```
87
87
88
-
For example, to override the daily code review prompt for a specific repo:
88
+
These files use the exact same format as built-in definitions (YAML frontmatter + prompt body). Codekin discovers them automatically and they appear alongside built-in workflows in the UI.
89
+
90
+
### Creating a Custom Workflow
91
+
92
+
1. Create the directory `{repoPath}/.codekin/workflows/` in your repo.
93
+
94
+
2. Add a `.md` file with the full frontmatter and prompt:
95
+
96
+
```markdown
97
+
---
98
+
kind: api-docs.weekly
99
+
name: API Documentation Check
100
+
sessionPrefix: api-docs
101
+
outputDir: .codekin/reports/api-docs
102
+
filenameSuffix: _api-docs.md
103
+
commitMessage: chore: api docs check
104
+
---
105
+
You are reviewing the API documentation for this project.
106
+
107
+
1. Find all REST endpoints and verify they have corresponding documentation
108
+
2. Check for outdated examples or missing parameters
109
+
3. Produce a Markdown report with a table of endpoints and their doc status
110
+
111
+
Important: Do NOT modify any source files.
112
+
```
113
+
114
+
3. In the Codekin UI, select a repo and click **Add Workflow**. Custom workflows defined in that repo will appear in the workflow selector with a "repo" label.
115
+
116
+
### Overriding Built-in Prompts
117
+
118
+
If a repo workflow file uses the same `kind` as a built-in (e.g. `code-review.daily`), the repo file's **prompt** replaces the built-in prompt at run time. The metadata (outputDir, commitMessage, etc.) still comes from the built-in definition.
119
+
120
+
For example, to customize the daily code review for a specific repo:
89
121
90
122
```
91
123
my-repo/.codekin/workflows/code-review.daily.md
92
124
```
93
125
94
-
The override file uses the same MD format (frontmatter + prompt body). At run time, the loader checks for this file first; if found, its prompt replaces the global one for that run. The frontmatter in an override file is parsed but only the `prompt` body is used — the workflow metadata (outputDir, commitMessage, etc.) always comes from the built-in definition.
95
-
96
-
**Use cases for per-repo overrides:**
126
+
**Use cases for overrides:**
97
127
98
128
- Focus the review on areas specific to this codebase (e.g. "pay special attention to the payment module")
99
129
- Adjust the report format or section headings
100
130
- Add repo-specific shell commands or file paths
101
131
- Restrict scope to certain directories or file types
102
132
133
+
### API: Listing Available Kinds
134
+
135
+
The `GET /api/workflows/kinds` endpoint returns all available workflow kinds. Pass `?repoPath=/path/to/repo` to include repo-specific workflows in the response:
To add a new built-in workflow, create a `.md` file in `server/workflows/` following the format above. It will be discovered and registered automatically at next server start — no code changes required.
150
+
To add a new built-in workflow that ships with Codekin, create a `.md` file in `server/workflows/` following the format above. It will be discovered and registered automatically at next server start — no code changes required.
108
151
109
152
Choose a `kind` that doesn't conflict with existing workflows. The convention is `<topic>.<frequency>` where frequency is one of `daily`, `weekly`, or `monthly`.
0 commit comments