Imported from kibocha-solutions/skills (
ci-cd/SKILL.md). Install upstream withnpx skills add kibocha-solutions/skills --skill ci-cd. Copyright stays with the author.
CI/CD
1. Classify the task
- Identify the repository, requested action, intended result, and publication boundary.
- Read the matching references:
- Git and history:
references/git-and-history.md - pipelines and deployment:
references/pipelines-and-deployments.md - security and operations:
references/security-and-operations.md - integration controls:
references/integration-controls.md - external standards:
references/authoritative-sources.md - repository health:
references/repo-health-cache.md - pull request text:
references/pull-request-messages.md - SSH signing bridge:
references/ssh-signing-relay.md
- Git and history:
- Activate
ssh/SKILL.mdfor SSH authentication, agents, keys, aliases, signing configuration, bastions, or production access. - Activate
documentation/SKILL.mdfor a documentation deliverable. - Inspect
examples/only when a concrete implementation pattern is required.
Absolute AI-attribution prohibition
- Never attribute repository work to AI, a model, an agent, an automated assistant, or an AI-assisted tool.
- Apply the prohibition to commits, author fields, co-author trailers, signatures, pull requests, issues, review comments, tags, release notes, changelogs, deployment records, generated-by fields, and publication metadata.
- Remove optional AI attribution inserted by a template, tool, hook, or generator before publication.
- Do not replace explicit attribution with coded, abbreviated, indirect, or euphemistic attribution.
- If a platform forces attribution that cannot be removed, do not publish through that path. Report the platform requirement to the user.
2. Build the repository-health snapshot
- Read
.agents/brain/git/repo-health.jsonwhen present. - Apply the staleness rules in
references/repo-health-cache.md. - Archive a stale snapshot under
.agents/brain/git/archives/. - Collect at least two complete commit records:
git log --show-signature -2 --date=iso-strict --format=fuller
- Collect:
git status- current branch
- configured upstream
- local and remote branches
git remote -vgit config user.namegit config user.emailgit config gpg.formatgit config user.signingkeygit config gpg.ssh.allowedSignersFilegit config core.sshCommandgit config gpg.ssh.programSSH_AUTH_SOCK
- Check the provider CLI and authentication for the remote host.
- Test the configured SSH host or alias.
- Store the refreshed snapshot at
.agents/brain/git/repo-health.json. - Invalidate the snapshot after a branch switch, remote change, SSH configuration change, or signing configuration change.
3. Resolve branch ancestry
- Read
.agents/brain/git/branch-ancestry.json. - Use an existing entry for the current branch when valid.
- Otherwise inspect, in order:
- the branch creation entry in its reflog
- its configured upstream
git merge-base --fork-pointagainst candidate branches
- Ask the user when no source resolves the parent unambiguously.
- Append the resolved ancestry to the durable log.
- Append an entry immediately after creating a branch.
- Never overwrite or archive the ancestry log.
4. Inspect the delivery surface
- Inspect the staged and unstaged diff.
- Inspect workflow files, build scripts, test commands, release scripts, deployment manifests, runner configuration, environment gates, artifact stores, secrets interfaces, and rollback hooks.
- Identify protected or shared history.
- Identify the current branch, intended base, publication state, review state, and collaborator use.
- Identify required checks and release gates.
- Stop when the requested mutation lacks authorization.
5. Select the workflow
Choose the matching path:
- commit creation or amendment
- local history cleanup
- shared branch collaboration
- pull request preparation
- CI repair
- pipeline design
- deployment or release
- security hardening
- incident rollback
- merge queue or merge train
Keep the steps limited to the selected path.
6. Create a final commit
- Confirm that
user.nameanduser.emailare set. - Confirm the expected signing configuration.
- Ask the user when signing was previously expected and is now absent.
- Record
signing_intentionally_disabledonly from the user's answer. - Record the starting commit before creating any commit.
- Determine the final commit count authorized by the user.
- Treat that count as an absolute maximum and the required delivered count when there are changes to commit.
- Use one final commit when the user does not specify a count.
- Never create an extra final commit for a secondary task, cleanup, validation record, generated artifact, or session record.
- When one final commit is authorized, include the entire intended change set in that one commit.
- Stage only the intended files.
- Inspect:
git status --short
git diff --cached
- Select one predominant durable purpose for the complete staged change set.
- Use that purpose for one type, one scope, and one subject.
- Do not assign a separate subject, sentence, paragraph, or bullet to each completed task.
- Use
assets/commit-message-template.mdfor the template and accepted and rejected examples. - Write the title as
type(scope): summary. - Use one canonical type:
featfixdocsstylerefactorperftestbuildcichorerevert
- Use one specific scope.
- Use
repoonly for repository infrastructure with no specific component at its center. - Write a concise imperative subject without a trailing period.
- Use one optional prose paragraph for the body.
- Keep the body at 72 words or fewer unless the user sets a stricter limit.
- Obey every user-specified word, character, line, title, body, or total message limit exactly.
- Never use bullets, numbered lists, headings, checklists, or tables in a commit message.
- Never put filenames, directory names, repository paths, or line references in a commit message.
- Omit task-by-task summaries, file lists, process narration, workspace mechanics, and unnecessary implementation detail.
- Mention secondary work only when it materially changes the durable purpose.
- Condense that secondary work into the same prose paragraph.
- Do not split the final history solely because the change set contains several tasks or strands.
- Do not create temporary or fixup commits when they would cause the delivered history to exceed the authorized count.
- Inspect the exact final message with:
git log -1 --format=%B
- Count commits from the recorded starting commit to
HEAD. - Stop before pushing when the count or message violates any rule above.
7. Enforce the publication boundary
Never name, cite, quote, or attribute any of these in a commit message, pull request description, or issue:
AGENTS.md- skills or skill instructions
- implementation plans
- task registers
- walkthroughs
- memory files
- handoffs
- sessions
- chat instructions
- temporary or scaffolding files
- internal drafting guidance
State the verified repository fact without citing an excluded source. Use durable code, documentation, schemas, tickets, or external standards when a citation is required.
Apply the absolute AI-attribution prohibition to every publication surface.
8. Handle commit and push failures
- Make no more than three attempts per logical change.
- Read the exact failure before each retry.
- Triage in this order:
- SSH agent reachability and identity path
- Git signing configuration
- remote connectivity and configured host alias
- remaining exact error
- Use the cached repository identity as the default identity.
- Use
ssh/SKILL.mdfor every SSH repair. - Never substitute
git@github.comfor a configured non-default alias. - Never remove, override, or bypass signing configuration.
- Never create an unsigned commit when signing is expected without live user authorization.
- Stop after the third failure.
- Report all three attempts and triage results.
- Ask the user to unlock, approve, or load the identified key when the SSH agent blocks the operation.
9. Clean local history
- Confirm the intended base and current branch ownership.
- Treat unclear ownership or publication state as shared.
- Use a disposable branch or worktree for risky cleanup.
- Use
git commit --fixupfor repair commits. - Use
git rebase -i --autosquashto produce the intended final history. - Rebase onto the latest parent before shipping.
- Verify the final diff and final commit.
- Advance one level at a time through the recorded ancestry chain.
- Apply each level's merge and review requirements.
- Obtain live confirmation before rewriting shared or reviewed history.
- Obtain live confirmation before deleting a shared, reviewed, published, or ambiguously owned branch.
- Delete a confirmed local disposable branch only after its work lands at the next ancestry level.
- Record the final ancestry and cleanup state.
10. Prepare a pull request
- Read
references/pull-request-messages.md. - Inspect the complete diff and commit range.
- Verify required tests and checks.
- Use the repository's pull request template.
- State the change, verification, operational impact, rollout, and rollback information required by the template.
- Keep excluded internal sources out of the title and description.
- Use the authenticated provider CLI when authorized and available.
- Verify the created pull request and its checks.
11. Implement CI, deployment, or release work
- Read the matching pipeline, security, and integration references.
- Define the current state and target flow.
- Use one auditable production path.
- Build an artifact once and promote the same immutable artifact.
- Define required tests, approvals, environment gates, rollout criteria, rollback criteria, and observability checks.
- Use least-privilege credentials.
- Prefer OIDC to long-lived deployment secrets.
- Pin workflow dependencies.
- Use merge queues or merged-result validation for high-throughput protected branches.
- Use the repository-approved merge method.
- Use revert-first incident handling while the cause remains unresolved.
- Verify the rollback path before release.
- Run the pipeline and inspect the exact final result.
12. Record handoff state
Record these fields when work continues in another session:
- current branch
- intended base branch
- branch purpose
- branch lifetime
- publication and review state
- history cleanup state
- procedural commit count when relevant
- required checks
- safest next Git action
13. Verify completion
- Reinspect
git status. - Reinspect the final diff or commit.
- Verify signatures when required.
- Verify remote state after a push.
- Verify pull request checks after creation or update.
- Verify pipeline, deployment, release, and rollback results against the exact run and artifact.
- Update the repository-health cache when its fields changed.
- Report the completed action, checks, warnings, and remaining blockers.