Files
codex-agent-repository-kit/agent-quickstart.md

193 lines
7.0 KiB
Markdown
Raw Normal View History

2026-05-02 02:33:57 +02:00
# Agent Quickstart
Use this file when you want Codex to apply the repository kit with minimal instructions.
2026-05-03 11:57:22 +02:00
## Required Agent Behavior
```text
Read manifest.json first.
Use its copyMap for file destinations.
Use new-repository.md or existing-project.md as the task workflow.
Use matching profiles/*.md guidance after detecting the stack.
2026-05-15 02:47:08 +02:00
At the start of each user-requested task, check for upstream repository updates and apply them immediately with a safe fast-forward pull when the working tree is clean.
If local changes exist, do not overwrite them; fetch or report the blocker before editing.
2026-05-03 22:01:41 +02:00
For releasable projects, add or preserve scheduled security automation.
For active projects, add or preserve non-destructive scheduled repository cleanup checks.
For Codex-maintained projects, add or preserve dependency, release dry-run, and template compliance checks when useful.
2026-05-03 11:57:22 +02:00
Check git status before editing.
Preserve unrelated user changes.
Replace all applicable placeholders and remove non-applicable placeholder sections.
Keep AGENTS.md and .codex/project.md aligned with real commands and artifact paths.
Update README.md whenever blueprint.md or blueprint.json changes.
Exclude Codex kit metadata from user-facing release, package, installer, archive, and GitHub/Gitea upload artifacts unless explicitly requested.
2026-05-03 11:57:22 +02:00
Run git diff --check before finishing.
Run the cheapest reliable verification command, or explain why it could not run.
```
2026-05-02 02:33:57 +02:00
## New Repository Prompt
```text
Apply the Codex Agent Repository Kit from templates/codex-project.
Use new-repository.md as the workflow.
Create the smallest useful baseline for this repository.
Detect the stack and replace placeholders with real project values.
Keep commands truthful: do not add commands that cannot run.
2026-05-03 11:57:22 +02:00
Use manifest.json as the source of truth for copy targets.
2026-05-02 02:33:57 +02:00
Keep the README generator only if it adds value.
2026-05-03 02:31:00 +02:00
When using the README generator, keep the rainbow `{{ template:section-line }}` divider between major sections.
2026-05-02 02:33:57 +02:00
Do not create a release.
Run the cheapest available verification before finishing.
```
## Existing Repository Prompt
```text
Apply the Codex Agent Repository Kit from templates/codex-project.
Use existing-project.md as the workflow.
Preserve existing code, README knowledge, CI behavior, and project style.
Add missing Codex agent context, security review, release checklist, and optional README generator files.
Keep commands truthful: do not add commands that cannot run.
2026-05-03 11:57:22 +02:00
Use manifest.json as the source of truth for copy targets.
2026-05-03 02:31:00 +02:00
When using or adding the README generator, keep the rainbow `{{ template:section-line }}` divider between major sections.
2026-05-02 02:33:57 +02:00
Do not create a release.
Run the cheapest available verification before finishing.
```
## Agent Decision Tree
```text
Is this a fresh repo?
yes -> use new-repository.md
no -> use existing-project.md
2026-05-03 11:57:22 +02:00
Did you read manifest.json?
yes -> use copyMap and placeholders from it
no -> read it before editing
2026-05-15 02:47:08 +02:00
Is the working tree clean at task start?
yes -> run a fast-forward update check such as git pull --ff-only before editing
no -> do not overwrite local changes; fetch or report the blocker before editing
Does a stack profile match?
yes -> read the matching profiles/*.md file and adapt commands carefully
no -> continue with universal rules only
2026-05-02 02:33:57 +02:00
Does the project already have README structure?
yes -> preserve it; only add blueprint files if useful
2026-05-03 02:31:00 +02:00
no -> add blueprint.md and blueprint.json with the rainbow section-line divider
2026-05-02 02:33:57 +02:00
Does the project produce artifacts?
yes -> add downloads/artifacts section and release checklist
no -> keep downloads section minimal or remove it
Does the project have CI?
yes -> patch existing workflow
no -> add .gitea/workflows/build.yml only when commands are known
2026-05-03 22:01:41 +02:00
Is the project releasable or does it process user/secrets/config data?
yes -> add .gitea/workflows/security-scan.yml or preserve equivalent scheduled security automation
no -> document why scheduled security automation is not needed
Is this an active repository with generated files, artifacts, or branches?
yes -> add .gitea/workflows/repo-cleanup.yml or preserve equivalent cleanup checks
no -> cleanup automation can be skipped
Is this an active project with dependencies?
yes -> add .gitea/workflows/dependency-check.yml or preserve equivalent dependency checks
no -> dependency automation can be skipped
Is this project releasable?
yes -> add .gitea/workflows/release-dry-run.yml or preserve equivalent release dry-run checks
no -> release dry-run can be skipped
Is this project intended to stay Codex-maintained?
yes -> add .gitea/workflows/template-compliance.yml or preserve equivalent template checks
no -> template compliance can be skipped
2026-05-02 02:33:57 +02:00
Are commands unknown?
yes -> document PENDING in .codex/project.md
no -> wire commands into AGENTS.md and CI
2026-05-03 02:08:36 +02:00
2026-05-03 11:57:22 +02:00
Did blueprint.md or blueprint.json change?
yes -> regenerate or manually update README.md and check the rendered structure
no -> leave README.md alone unless content changed
Did release behavior, artifacts, or downloads change?
yes -> update docs/release-checklist.md and README downloads/artifacts
no -> do not invent release details
Does the user expect a Gitea Package Registry package?
yes -> add an explicit generic package upload step; upload-artifact alone is not enough
no -> workflow-run artifacts may be sufficient
Do package upload URLs include raw build filenames?
yes -> copy artifacts to URL-safe filenames first, then upload those names
no -> continue
Do user-facing release artifacts include Codex kit metadata such as AGENTS.md, .codex/, blueprint files, template workflows, or agent handoff notes?
yes -> exclude those files unless the user explicitly asked to ship repository-maintenance files
no -> continue
Is the work interrupted, risky, or multi-session?
yes -> update docs/agent-handoff.md
no -> no handoff file is required
2026-05-03 02:08:36 +02:00
Is this a private Gitea repo with Actions?
yes -> if GITEA_TOKEN is set locally, use it for read-only API checks of repository and workflow-run status
no -> use public web/API checks when available
2026-05-03 02:10:10 +02:00
Did you push a commit that should trigger a workflow?
yes -> poll the workflow run until success; if it fails, inspect logs, fix in scope, push again, and keep looping after the follow-up push
2026-05-03 02:10:10 +02:00
no -> finish with local verification status
2026-05-02 02:33:57 +02:00
```
## Minimal File Set
For tiny projects:
```text
AGENTS.md
.codex/project.md
README.md
SECURITY.md
CHANGELOG.md
```
For releasable projects:
```text
AGENTS.md
.codex/project.md
README.md
SECURITY.md
CHANGELOG.md
docs/release-checklist.md
docs/security-review.md
docs/agent-handoff.md
2026-05-02 02:33:57 +02:00
.gitea/workflows/build.yml
2026-05-03 22:01:41 +02:00
.gitea/workflows/security-scan.yml
.gitea/workflows/repo-cleanup.yml
.gitea/workflows/dependency-check.yml
.gitea/workflows/release-dry-run.yml
.gitea/workflows/template-compliance.yml
2026-05-02 02:33:57 +02:00
```
For README-generator projects:
```text
blueprint.md
blueprint.json
README.md
```
For stack-specific guidance:
```text
profiles/node.md
profiles/electron.md
profiles/python.md
profiles/docker.md
profiles/static-site.md
```