ワンクリックで
contenthawk-manage-campaigns
Visualize and manage all active ContentHawk content campaigns for a target GitHub repository.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Visualize and manage all active ContentHawk content campaigns for a target GitHub repository.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Start a new ContentHawk content campaign on a target GitHub repository.
Install SSW ContentHawk on a target GitHub repository by setting the required GitHub Actions secrets. Use when the user wants to set up, install, or configure ContentHawk on a GitHub repo, or asks to add ContentHawk secrets to a repository.
| name | contenthawk-manage-campaigns |
| description | Visualize and manage all active ContentHawk content campaigns for a target GitHub repository. |
You are preparing the arguments for scripts/content-hawk.ts in campaigns mode to do this you will read the state of all campaigns from markdown tables stored in the target repository.
scripts/types.ts)type CheckResult = "skipped" | "pending" | number; // number = GitHub issue number e.g. 15
interface ContentItem {
path: string;
checkResult: CheckResult;
checkedDate: string; // "YYYY-MM-DD" or "-"
lastUpdated: string; // "YYYY-MM-DD" or "-"
categoryList: string;
createdDate: string; // "YYYY-MM-DD"
}
interface CampaignData {
done?: boolean; // true when the snapshot comes from the DONE folder
items: ContentItem[];
}
type ContentCatalog = Record<string, CampaignData>;
gh is authenticated. Run gh auth status. If it fails, tell the user to run gh auth login and stop.git config --global user.name. and git config --global user.email. If neither command returns a value, tell the user to set their username or email with git config --global user.name "Your Name" or git config --global user.email "your.email@example.com" and stop.Ask the user: Which GitHub repository would you like to manage campaigns for? (format: owner/repo)
Initialize an empty ContentCatalog object:
const contentCatalog: ContentCatalog = {};
Use the GitHub REST API to list the contents of both the TODO and DONE folders in the target repo:
gh api repos/<owner/repo>/contents/.github/ContentHawk/TODO
gh api repos/<owner/repo>/contents/.github/ContentHawk/DONE
Each call returns a JSON array of file objects (or a 404 if the folder doesn't exist — handle gracefully by treating it as an empty list). Filter for entries where name ends with .md.
For each .md file from either folder, fetch its raw content using WebFetch on the file's download_url field from the API response.
For each file:
Find the ## Agent Configuration section and locate the row where the first column is Label. Extract the value (strip surrounding backticks if present). This is the catalog key for this file.
Find the ## Files to Review section. Parse every data row (skip the header and separator rows). For each row, map the columns to a ContentItem:
| Markdown column | ContentItem field | Notes |
|---|---|---|
Path | path | Use as-is |
CategoryList | categoryList | Use as-is |
Created | createdDate | Use as-is (YYYY-MM-DD or -) |
LastUpdated | lastUpdated | Use as-is (YYYY-MM-DD or -) |
CheckedDate | checkedDate | Use as-is (YYYY-MM-DD or -) |
CheckResult | checkResult | See parsing rules below |
CheckResult parsing rules:
pending → "pending"skipped → "skipped"Issue #<N> (e.g. Issue #101) → the integer N (e.g. 101)"pending"Use the extracted Label as the key in ContentCatalog. The value must be a CampaignData object:
items: the array of parsed ContentItemsdone: true if the snapshot came from the DONE folder, omit (or false) for TODO snapshots.The order of entries in ContentCatalog determines which campaign is shown as "Current" in the UI. Insert entries in this order:
YYYY-MM-DD prefix of the snapshot filename). The oldest TODO campaign is the active one and will be marked "Current".Lexicographic sort on the filename is sufficient because the YYYY-MM-DD prefix is zero-padded.
Serialize the ContentCatalog to a compact JSON string (no pretty-printing).
Run the workflow runner in campaigns mode:
npx ssw-contenthawk@latest campaigns <owner/repo> '<content-catalog-json>'
Replace <owner/repo> with the value from Step 1 and <content-catalog-json> with the serialized JSON.
When the command finishes executing it means the user has finished. If the user needs to view the campaign statuses again after the script has run, you will need to rebuild the <content-catalog-json> before running the command again by repeating steps 2-5.