@uniswap/ai-toolkit-linear-task-utils 0.0.1 → 0.0.2-next.0

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.
package/README.md CHANGED
@@ -1,45 +1,186 @@
1
1
  # @uniswap/ai-toolkit-linear-task-utils
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
3
+ CLI tool to query Linear issues for autonomous Claude Code task processing in GitHub Actions workflows.
4
4
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
5
+ ## Installation
6
6
 
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
7
+ ```bash
8
+ # Use directly via npx (recommended for CI)
9
+ npx @uniswap/ai-toolkit-linear-task-utils query --team "Developer AI" --label "claude"
8
10
 
9
- ## Purpose
11
+ # Or install globally
12
+ npm install -g @uniswap/ai-toolkit-linear-task-utils
13
+ ```
10
14
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@uniswap/ai-toolkit-linear-task-utils`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
15
+ ## Commands
15
16
 
16
- ## What is OIDC Trusted Publishing?
17
+ ### query
17
18
 
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
19
+ Query Linear issues matching criteria and output a JSON matrix for GitHub Actions.
19
20
 
20
- ## Setup Instructions
21
-
22
- To properly configure OIDC trusted publishing for this package:
23
-
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
28
-
29
- ## DO NOT USE THIS PACKAGE
30
-
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
36
-
37
- ## More Information
38
-
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
42
-
43
- ---
44
-
45
- **Maintained for OIDC setup purposes only**
21
+ ```bash
22
+ npx @uniswap/ai-toolkit-linear-task-utils query \
23
+ --team "Developer AI" \
24
+ --label "claude" \
25
+ --statuses "Backlog,Todo" \
26
+ --max 3
27
+ ```
28
+
29
+ **Options:**
30
+
31
+ | Option | Default | Description |
32
+ | ------------ | -------------- | ---------------------------- |
33
+ | `--team` | "Developer AI" | Linear team name |
34
+ | `--label` | "claude" | Label to filter by |
35
+ | `--statuses` | "Backlog,Todo" | Comma-separated status names |
36
+ | `--max` | 3 | Maximum issues to return |
37
+
38
+ **Output (JSON to stdout):**
39
+
40
+ ```json
41
+ {
42
+ "include": [
43
+ {
44
+ "issue_id": "abc123",
45
+ "issue_identifier": "DAI-123",
46
+ "issue_title": "Fix authentication bug",
47
+ "issue_description": "Full description...",
48
+ "issue_url": "https://linear.app/...",
49
+ "branch_name": "claude/dai-123-fix-auth-bug",
50
+ "priority": 1,
51
+ "priority_label": "Urgent"
52
+ }
53
+ ],
54
+ "count": 1
55
+ }
56
+ ```
57
+
58
+ ### ensure-label
59
+
60
+ Ensure a label exists in the specified team. Creates it if missing.
61
+
62
+ ```bash
63
+ npx @uniswap/ai-toolkit-linear-task-utils ensure-label \
64
+ --team "Developer AI" \
65
+ --label "claude" \
66
+ --color "#6366f1"
67
+ ```
68
+
69
+ **Options:**
70
+
71
+ | Option | Default | Description |
72
+ | --------- | -------------- | --------------------------- |
73
+ | `--team` | "Developer AI" | Linear team name |
74
+ | `--label` | "claude" | Label name to ensure exists |
75
+ | `--color` | "#6366f1" | Label color (hex) |
76
+
77
+ ### update-issue
78
+
79
+ Update an issue status and optionally attach a PR link.
80
+
81
+ ```bash
82
+ npx @uniswap/ai-toolkit-linear-task-utils update-issue \
83
+ --issue-id "abc123" \
84
+ --status "In Review" \
85
+ --pr-url "https://github.com/org/repo/pull/123"
86
+ ```
87
+
88
+ **Options:**
89
+
90
+ | Option | Required | Description |
91
+ | ------------ | -------- | ----------------------------------- |
92
+ | `--issue-id` | Yes | Linear issue ID |
93
+ | `--status` | Yes | New status name (e.g., "In Review") |
94
+ | `--pr-url` | No | PR URL to attach |
95
+ | `--comment` | No | Comment to add to the issue |
96
+
97
+ ## Authentication
98
+
99
+ Set the `LINEAR_API_KEY` environment variable:
100
+
101
+ ```bash
102
+ export LINEAR_API_KEY="lin_api_xxxxx"
103
+ ```
104
+
105
+ Or pass via CLI flag (not recommended for CI - shows in process list):
106
+
107
+ ```bash
108
+ npx @uniswap/ai-toolkit-linear-task-utils query --api-key "lin_api_xxxxx"
109
+ ```
110
+
111
+ ## GitHub Actions Usage
112
+
113
+ ### Querying Issues for Matrix Strategy
114
+
115
+ ```yaml
116
+ jobs:
117
+ prepare:
118
+ runs-on: ubuntu-latest
119
+ outputs:
120
+ matrix: ${{ steps.query.outputs.result }}
121
+ has_tasks: ${{ steps.query.outputs.has_tasks }}
122
+ steps:
123
+ - name: Query Linear issues
124
+ id: query
125
+ run: |
126
+ RESULT=$(npx @uniswap/ai-toolkit-linear-task-utils query \
127
+ --team "${{ inputs.linear_team }}" \
128
+ --label "${{ inputs.linear_label }}" \
129
+ --max "${{ inputs.max_issues }}")
130
+
131
+ echo "result=$RESULT" >> $GITHUB_OUTPUT
132
+
133
+ COUNT=$(echo "$RESULT" | jq -r '.count')
134
+ if [ "$COUNT" -gt 0 ]; then
135
+ echo "has_tasks=true" >> $GITHUB_OUTPUT
136
+ else
137
+ echo "has_tasks=false" >> $GITHUB_OUTPUT
138
+ fi
139
+ env:
140
+ LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
141
+
142
+ process-task:
143
+ needs: prepare
144
+ if: needs.prepare.outputs.has_tasks == 'true'
145
+ strategy:
146
+ fail-fast: false
147
+ matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
148
+ runs-on: ubuntu-latest
149
+ steps:
150
+ - name: Process task ${{ matrix.issue_identifier }}
151
+ run: echo "Working on ${{ matrix.issue_title }}"
152
+ ```
153
+
154
+ ### Updating Issue After PR Creation
155
+
156
+ ```yaml
157
+ - name: Update Linear issue
158
+ if: steps.create-pr.outputs.pr_url != ''
159
+ run: |
160
+ npx @uniswap/ai-toolkit-linear-task-utils update-issue \
161
+ --issue-id "${{ matrix.issue_id }}" \
162
+ --status "In Review" \
163
+ --pr-url "${{ steps.create-pr.outputs.pr_url }}"
164
+ env:
165
+ LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
166
+ ```
167
+
168
+ ## Priority Sorting
169
+
170
+ Issues are sorted by priority in this order:
171
+
172
+ 1. **Urgent** (priority = 1)
173
+ 2. **High** (priority = 2)
174
+ 3. **Normal** (priority = 3)
175
+ 4. **Low** (priority = 4)
176
+ 5. **No Priority** (priority = 0)
177
+
178
+ ## Related
179
+
180
+ - [AI Toolkit](https://github.com/Uniswap/ai-toolkit) - Standardized Claude Code setup
181
+ - [Claude Code Action](https://github.com/anthropics/claude-code-action) - GitHub Action for Claude Code
182
+ - [Linear API](https://developers.linear.app/) - Linear API documentation
183
+
184
+ ## License
185
+
186
+ MIT