Skip to content
Back to skills

Bump Cabal Index State

ASecurity

Update Cabal project index-state to the latest timestamp. Use when it needs to bump the cabal index-state.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 27, 2026
data-aibashgit

Works with

  • cli

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add ncaq/konoka --skill bump-cabal-index-state --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bump Cabal Index State?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Bump Cabal Index State
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ncaq-bump-cabal-index-state/badge)](https://www.skillsdirectory.com/skills/ncaq-bump-cabal-index-state)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: bump-cabal-index-state
description: Update Cabal project index-state to the latest timestamp. Use when it needs to bump the cabal index-state.
allowed-tools: Bash(cabal build:*), Bash(cabal update:*), Bash(gh pr create:*), Bash(git add:*), Bash(git commit:*), Bash(git push:*), Bash(git status:*), Bash(git switch:*), Bash(nix flake check:*), Edit, Glob, Grep, Read, Write
---

cabalプロジェクトの`index-state`を最新に更新します。

# 手順

## ブランチの作成

PR作成に備えてブランチを作成します。

```bash
git switch -c bump-cabal-index-state
```

## cabal updateの実行

```bash
cabal update
```

cabal updateの出力から最新の`index-state`タイムスタンプを取得します。
出力例:

```console
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date.
The index-state is set to 2026-01-11T09:48:01Z.
```

## index-stateの更新

通常は`cabal.project`ファイルに書かれている`index-state`を更新します。

フォーマット: `index-state: YYYY-MM-DDTHH:mm:ssZ`

`index-state`と日時の間にURLが入っていることも稀にあります。

もし`cabal.project`に書いていないなら、
`cabal.project.local`や`flake.nix`などに書かれている場合があります。
探して更新してください。

## 動作確認

プロジェクトのビルドシステムに応じて動作確認を行います。

Nixを使用している場合は以下のコマンドを実行してください。

```bash
nix flake check
```

Nixを使用していない場合は以下のコマンドを実行してください。

```bash
cabal build --disable-optimization --enable-tests all
```

### haskell.nixを使用している場合の遅れへの対応

haskell.nixは最新の`index-state`への対応に遅れがあります。
そのため最新の`index-state`を使用するとエラーになることがあります。
エラーメッセージに現在認識している最新の`index-state`が表示されます。

例:

```console
> Error: [Cabal-7159]
> Latest known index-state for 'hackage.haskell.org' (2026-01-05T23:03:18Z) is older than the requested index-state (2026-01-11T18:45:48Z).
> Run 'cabal update' or set the index-state to a value at or before 2026-01-05T23:03:18Z.
```

このエラーが出た場合は、
エラーメッセージに記載されている最新の値を使用してください。

変更した後に再度動作確認を行ってください。

## Gitにコミット

動作確認が成功したらGitにコミットしてください。
動作確認が成功しなければコミットは行わないで完了報告に進んでください。

コミットメッセージのタイトルは、
`build(deps): cabalのindex-stateを更新`
です。

本文は以下のテンプレートに従ってください。

```markdown
`cabal.project`の`index-state`を`YYYY-MM-DDTHH:mm:ssZ`に更新しました。
```

このテンプレートを置き換えて本文を作成してください。

`cabal.project`は実際に更新したファイル名に置き換えてください。
大抵は`cabal.project`そのままです。

`YYYY-MM-DDTHH:mm:ssZ`は実際の新しい`index-state`に置き換えてください。

ドメイン指定がある場合は`index-state`の前にスペースで囲んで、
`hackage.haskell.org`のように更新したドメインを追加してください。

## GitHubにプルリクエストを作成する

まずGitHubを利用しているか確認してください。
GitHubを利用していない場合はこの手順をスキップしてください。

GitHubを利用している場合は以下のGitコマンドでリモートリポジトリにプッシュしてください。

```bash
git push --verbose --set-upstream origin
```

その後以下のGitHub CLIコマンドでプルリクエストを作成してください。

```bash
gh pr create --assignee @me --fill --label "Type: Dependencies" --title "build(deps): cabalのindex-stateを更新"
```

# 完了報告

更新が完了したら以下を報告してください:

- 動作確認が成功したか
- 更新前の`index-state`
- 更新後の`index-state`
- haskell.nixを使用している場合、haskell.nixが認識している最新`index-state`がcabalの最新`index-state`に比べてどれぐらい遅れているか
- プルリクエストを作成した場合はプルリクエストのURL

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.