Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 67 additions & 32 deletions .codex/skills/iconland-add-icon/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,77 @@ Use this skill when the user gives two SVG files for one icon (normal + filled)
- Icon `Type` in PascalCase (example: `Alert`, `Media`, `Docs`).
- Icon `name` in kebab-case (example: `exclamation-circle`).

Uploaded SVG filenames can be anything. The script renames them to the required iconland seed names automatically.
Uploaded SVG filenames can be anything. Always rename to the required iconland seed names when copying.

## Command
## Workflow

```bash
bash .codex/skills/iconland-add-icon/scripts/add-icon-pair.sh \
<Type> \
<name> \
/absolute/path/normal.svg \
/absolute/path/filled.svg
```

## What the script does

1. Validates `<Type>` and `<name>`, then renames/copies the uploaded SVGs into iconland seeds (`Type_name.svg` and `Type_name-filled.svg`).
2. Ensures `iconland` submodule is clean before making changes.
3. Ensures `iconland` is on its default remote branch (if detached, it checks out tracked default branch).
4. Copies both files to `iconland/seeds/`.
5. Commits and pushes the change in `iconland`.
6. Runs `git submodule update --remote --merge iconland` in `grauity`.
7. Runs `npm run build-icons`.
8. Runs `npm run lint`.

## Notes

- This script intentionally does not create a grauity commit; after review, create a grauity branch, commit final changes, push, and open a PR.
- If the user does not provide `Type` or `name`, ask for them before running the script.
1. Validate inputs before changing files.
- Ask for missing `Type` or `name`.
- Reject invalid `Type` values unless they match `^[A-Z][A-Za-z0-9]*$`.
- Reject invalid `name` values unless they match `^[a-z0-9]+(-[a-z0-9]+)*$`.
- Confirm both SVG paths exist.
2. Set working variables in the repository root.
```bash
REPO_ROOT="$(git rev-parse --show-toplevel)"
cd "$REPO_ROOT"
ICON_KEY="${TYPE}_${NAME}"
NORMAL_DEST="iconland/seeds/${ICON_KEY}.svg"
FILLED_DEST="iconland/seeds/${ICON_KEY}-filled.svg"
```
3. Initialize and sync the `iconland` submodule on `master`.
```bash
git submodule update --init iconland
git -C iconland fetch origin master
if git -C iconland show-ref --verify --quiet refs/heads/master; then
git -C iconland checkout master
else
git -C iconland checkout -b master origin/master
fi
git -C iconland pull --ff-only origin master
```
4. Ensure destination and submodule state are safe.
- Stop if either destination file already exists.
- Stop if `git -C iconland status --porcelain` is not empty.
- Resolve blockers instead of forcing destructive resets.
5. Copy SVGs to the required iconland seed names and stage them in `iconland`.
```bash
cp "$NORMAL_SRC" "$NORMAL_DEST"
cp "$FILLED_SRC" "$FILLED_DEST"
git -C iconland add "seeds/${ICON_KEY}.svg" "seeds/${ICON_KEY}-filled.svg"
```
6. Commit and push in `iconland`.
```bash
git -C iconland commit -m "feat(icons): add ${ICON_KEY} icon pair"
git -C iconland push origin master
```
7. Update the submodule pointer in `grauity`, then regenerate and lint.
```bash
git submodule update --remote --merge iconland
npm run build-icons
npm run lint
```
- If build or lint fails, debug and apply the smallest safe fix, then rerun.
8. Review `grauity` changes and open a PR.
- Inspect `git status` and verify only intended files changed.
- Create a branch using the repository branch naming convention.
- Commit generated updates and the submodule pointer.
- Push and open a PR.

## After script completion (required)
## Main skill responsibilities

1. Review all resulting `grauity` changes (submodule pointer + generated icon outputs).
2. Create a `grauity` branch using the `cybersaksham/codex/` prefix.
3. Commit the final `grauity` changes with a clear message.
4. Push the branch to origin.
5. Open a PR in `grauity` that summarizes the new icon pair and includes any validation results (`npm run build-icons`, `npm run lint`).
6. If a Slack connector is available, send this message to `#developement` (must include `@core-dev`):
1. Execute the full manual workflow above to perform the iconland update plus local generation/lint steps.
2. Review all resulting `grauity` changes (submodule pointer + generated icon outputs), create a `grauity` branch using the repository branch naming convention, commit, push, and open a PR.
3. For Slack connector checks, first look for `SLACK_BOT_TOKEN_GRAUITY_CODEX_CONNECTOR` in the environment; if it is not present, use `SLACK_BOT_TOKEN` as fallback.
4. If a Slack connector is available, post to `#development` using this decision flow:
- If the global `slack-bot` skill is available in the current session, use that skill to send the message.
- Otherwise, use Slack Web API directly and resolve IDs before posting:
- Resolve channel name to channel ID.
- Resolve user mentions to user IDs and format them as `<@U12345>`.
- Resolve user group mentions to group IDs and format them as `<!subteam^S12345|@group-handle>`.
- Format links as `<https://example.com|label>`.
- Keep rich text in Slack mrkdwn format (`*bold*`, `_italic_`, `~strike~`, `` `code` ``, fenced code blocks).
- Send the final message with `chat.postMessage` after all mention/link substitutions.
5. Use this message template:

```text
@core-dev Please review and merge
Expand Down
6 changes: 3 additions & 3 deletions .codex/skills/iconland-add-icon/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
interface:
display_name: "Iconland Add Icon"
short_description: "Add one icon pair into iconland"
default_prompt: "Add this icon pair to grauity using the iconland workflow. Use explicit icon Type and name (ask for them if missing), ignore uploaded filenames, and return the resulting git status."
display_name: 'Iconland Add Icon'
short_description: 'Add one icon pair into iconland'
default_prompt: 'Add this icon pair to grauity using the iconland workflow. Use explicit icon Type and name (ask for them if missing), ignore uploaded filenames, run the manual skill steps, then create a grauity branch using the repository branch naming convention, commit, push, and open a PR. For Slack connector checks, first read SLACK_BOT_TOKEN_GRAUITY_CODEX_CONNECTOR from env and if it is missing use SLACK_BOT_TOKEN as fallback. If posting to Slack, use the global slack-bot skill when available; otherwise resolve user IDs and user-group IDs, convert links to Slack link format, preserve rich text in mrkdwn, and then post.'
168 changes: 0 additions & 168 deletions .codex/skills/iconland-add-icon/scripts/add-icon-pair.sh

This file was deleted.

20 changes: 20 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# AGENTS.md instructions for this repository

## Skills

A skill is a set of local instructions stored in a `SKILL.md` file.

### Available skills

- `iconland-add-icon`: Use when the user wants to add a new icon to grauity.
file: `.codex/skills/iconland-add-icon/SKILL.md`

### How to use skills

- Trigger rules: If the user names a skill (`$SkillName` or plain text) or the task clearly matches a skill description, use that skill for the turn.
- Missing or blocked skill: If a named skill path cannot be read, state that briefly and continue with the best fallback.
- Progressive disclosure:
1. Open only the selected skill `SKILL.md`.
2. Resolve relative paths from the skill directory first.
3. Load only referenced files needed for the task.
4. Prefer running skill scripts over re-implementing them.