githubnext / githubnext/gh-aw-cao

[ambient-context:skills-curator] Extract procedure-shaped AGENTS.md sections into skills (github/gh-aw-actions)

Closed
#1,786 0 comments 0 reactions 0 assignees View on GitHub
ambient-context ambient-context:skills-curator
Dominant language
JavaScript
Stars
3
Forks
1
Avg merge
49m
Merged PRs (30d)
837

Description

This repository (`github/gh-aw-actions`, `AGENTS.md` checked out at `be41add`) has `AGENTS.md` present (44,555 bytes / ~11,139 estimated tokens) but **zero skills** exist anywhere in the tree (no `skills/` directory, no `SKILL.md` files, confirmed via `git ls-tree -r HEAD` and filesystem search). `AGENTS.md` nonetheless already documents an "Available Skills Reference" section pointing at 20+ skill paths (e.g. `skills/developer/SKILL.md`, `skills/github-mcp-server/SKILL.md`) that do not exist in this checkout — those are out of scope here (staleness/correctness of `AGENTS.md` prose belongs to the `ambient-context-agents-md-curator` mission). This issue is scoped strictly to layering: which procedure-shaped content should move out of the always-loaded file into skills.

Because `skill_count` is 0, the only available work is recommending **extraction** of clearly procedure-shaped `AGENTS.md` sections into new skills, per the package's Step 1 guidance.

### Skill inventory

| Item | Value |
| --- | --- |
| Skills present | 0 |
| `AGENTS.md` size | 44,555 bytes / 1,162 lines / ~11,139 estimated tokens |
| In-flight instruction PRs | none |

Procedure-shaped `AGENTS.md` sections (large size + numbered steps, evidence from prefetch):

| Section | char_count | numbered_steps |
| --- | --- | --- |
| ⚠️ MANDATORY PRE-COMMIT VALIDATION ⚠️ | 4,480 | 2 |
| Channel Lifecycle Guidelines | 3,195 | 4 |
| YAML File Editing - ANSI Escape Code Prevention | 893 | 4 |

### Estimated gain

Always-loaded context today: 11,139 tokens (AGENTS.md only; 0 skill name/description tokens since no skills exist).

| Change | Tokens removed from AGENTS.md | Tokens added (pointer + new skill name/description) | Net |
| --- | --- | --- | --- |
| Extract "MANDATORY PRE-COMMIT VALIDATION" → skill | ~1,075 | ~48 | ~-1,027 |
| Extract "Channel Lifecycle Guidelines" → skill | ~756 | ~45 | ~-711 |
| Extract "YAML File Editing - ANSI Escape Code Prevention" → skill | ~186 | ~43 | ~-143 |
| **Total** | **~2,017** | **~136** | **~-1,881** |

Net reduction: **~1,881 tokens, ≈16.9%** of the current 11,139-token always-loaded baseline. This clears the 10% gain gate.

### Proposed changes

1. **Extract** — `AGENTS.md` § "⚠️ MANDATORY PRE-COMMIT VALIDATION ⚠️" (lines ~33–163, 4,480 chars, 2 numbered steps, several code blocks and a checklist) → new skill `skills/pre-commit-validation/SKILL.md`. Replace the section in `AGENTS.md` with a one-line pointer that still states the non-negotiable command (`make agent-finish`) so routine tasks don't need to open the skill. Evidence: prefetch section entry (`char_count: 4480`, `numbered_steps: 2`, `mentions_skill: true`).
- Proposed pointer text: `**Before every commit, run `make agent-finish`** (build, test, recompile, fmt, lint) — CI will fail otherwise. See [pre-commit-validation skill](skills/pre-commit-validation/SKILL.md) for the full checklist, build-tag rules, and linting details.`

2. **Extract** — `AGENTS.md` § "Channel Lifecycle Guidelines" (3,195 chars, 4 numbered steps, ownership rules + anti-patterns) → new skill `skills/go-channel-lifecycle/SKILL.md`. Leave a pointer naming the core rule. Evidence: prefetch section entry (`char_count: 3195`, `numbered_steps: 4`).
- Proposed pointer text: `**Document channel ownership; sender closes, never the receiver.** See [go-channel-lifecycle skill](skills/go-channel-lifecycle/SKILL.md) for ownership rules, signal-channel patterns, and anti-patterns to avoid goroutine leaks.`

3. **Extract** — `AGENTS.md` § "YAML File Editing - ANSI Escape Code Prevention" (893 chars, 4 numbered steps) → new skill `skills/yaml-ansi-safety/SKILL.md`. Leave a pointer stating the core rule. Evidence: prefetch section entry (`char_count: 893`, `numbered_steps: 4`).
- Proposed pointer text: `**Never copy-paste colored terminal output into YAML workflow files** — strip ANSI codes and run `make recompile`. See [yaml-ansi-safety skill](skills/yaml-ansi-safety/SKILL.md) for detection and prevention steps.`

No merge, split, sharpen, or retire actions are proposed: there are no existing skills to merge into, split, or retire, and there are no existing skill descriptions to sharpen.

### Agentic update prompt

```text
You are updating the repository `github/gh-aw-actions` at its default branch. Only create or edit these files:
- AGENTS.md
- skills/pre-commit-validation/SKILL.md (new)
- skills/go-channel-lifecycle/SKILL.md (new)
- skills/yaml-ansi-safety/SKILL.md (new)

Do not touch any other file.

Before applying each instruction below, re-open AGENTS.md and verify the named section still exists with substantially the same content described. If a section no longer exists, has been substantially rewritten, or no longer matches the description, SKIP that instruction and note it as skipped in the PR description — do not force the change.

1. Verify AGENTS.md contains a section titled "⚠️ MANDATORY PRE-COMMIT VALIDATION ⚠️" describing the make agent-finish workflow, CI failure rationale, build-tag rules for test files, and lint guidance. If present, move its full content into a new file skills/pre-commit-validation/SKILL.md with YAML frontmatter `name: pre-commit-validation` and a `description` that states exactly when to invoke it (e.g. "Invoke before committing any change to gh-aw-actions; provides the mandatory make agent-finish sequence (build, test, recompile, fmt, lint), CI-failure rationale, build-tag rules for *_test.go files, and post-test-file linting requirements") and what it does. Replace the section in AGENTS.md with a single pointer line: "**Before every commit, run `make agent-finish`** (build, test, recompile, fmt, lint) — CI will fail otherwise. See [pre-commit-validation skill](skills/pre-commit-validation/SKILL.md) for the full checklist, build-tag rules, and linting details."

2. Verify AGENTS.md contains a section titled "Channel Lifecycle Guidelines" describing Go channel ownership rules, best practices, signal channels, and anti-patterns. If present, move its full content into skills/go-channel-lifecycle/SKILL.md with YAML frontmatter `name: go-channel-lifecycle` and a description stating when to invoke it (e.g. "Invoke when writing or reviewing Go code that creates, closes, or synchronizes on channels; covers ownership rules, signal-channel patterns, and anti-patterns that cause goroutine leaks or panics") and what it does. Replace the section in AGENTS.md with a single pointer line: "**Document channel ownership; sender closes, never the receiver.** See [go-channel-lifecycle skill](skills/go-channel-lifecycle/SKILL.md) for ownership rules, signal-channel patterns, and anti-patterns to avoid goroutine leaks."

3. Verify AGENTS.md contains a section titled "YAML File Editing - ANSI Escape Code Prevention" describing how to avoid ANSI escape codes in workflow YAML files. If present, move its full content into skills/yaml-ansi-safety/SKILL.md with YAML frontmatter `name: yaml-ansi-safety` and a description stating when to invoke it (e.g. "Invoke when editing or generating .github/workflows/*.yml or *.lock.yml files, especially after copy-pasting terminal output; covers ANSI-escape detection, prevention, and the make recompile fix") and what it does. Replace the section in AGENTS.md with a single pointer line: "**Never copy-paste colored terminal output into YAML workflow files** — strip ANSI codes and run `make recompile`. See [yaml-ansi-safety skill](skills/yaml-ansi-safety/SKILL.md) for detection and prevention steps."

After applying the changes you verified, confirm that AGENTS.md's estimated token count (chars/4) plus the name+description token count of every skill (existing and new) is at least 10% smaller than the original baseline of ~11,139 tokens for AGENTS.md alone (there were no pre-existing skills). If you had to skip enough instructions that this 10% reduction is not met, state that explicitly in the pull request description rather than padding the diff with unrelated changes.

Each new SKILL.md description must name both the trigger condition (when to invoke it) and the concrete action/content it provides — do not use vague descriptions like "Helps with X".

Do not delete, rename, or propose deleting any existing skill (there are none) without maintainer confirmation; this task only adds new skills and pointers.

Open a pull request whose description lists, for each of the three instructions above: whether it was applied or skipped, the evidence checked, and the resulting content moved. Include the before/after estimated token count for AGENTS.md's always-loaded content.
```

### Verification

A reviewer should confirm:
- `AGENTS.md`'s estimated token count (chars ÷ 4) is at least 10% lower than the pre-change baseline of ~11,139 tokens, even after adding the name+description tokens of the three new skills.
- Each of the three moved procedures (pre-commit validation, channel lifecycle, YAML ANSI safety) exists in exactly one place — the new skill file — with only a one-line pointer remaining in `AGENTS.md`.
- Each new `skills/*/SKILL.md` description states both a trigger condition ("invoke when...") and the concrete action/content provided.
- No other files were touched, and no skill was deleted.

### Control Plane

- Correlation ID: `33912150262-39`
- Central repository: `githubnext/gh-aw-cao`
- Control plane run: https://github.com/githubnext/gh-aw-cao/actions/runs/33912150262

> Generated by [:toolbox: Ambient Context / Skills](https://github.com/githubnext/gh-aw-cao/actions/runs/33912579375) · copilot · auto · 48.2 AIC · ⌖ 17.2 AIC · ⊞ 15.2K · [◷](https://github.com/search?q=repo%3Agithubnext%2Fgh-aw-cao+is%3Aissue+%22gh-aw-workflow-call-id%3A+githubnext%2Fgh-aw-cao%2Fambient-context-skills-curator%22&type=issues)
> - [x] expires on Oct 4, 2026, 7:52 PM UTC

Contributor guide

Open the contributing guide

Research direction

Reopen AGENTS.md and verify the three named sections before moving them into skills/pre-commit-validation/SKILL.md, skills/go-channel-lifecycle/SKILL.md, and skills/yaml-ansi-safety/SKILL.md. Confirm each procedure exists only in its new skill with a pointer remaining, the token reduction clears 10%, and no other files were changed.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, go, yaml
Domain
documentation
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.