diff --git a/docs/CURRENT_STATE.md b/docs/CURRENT_STATE.md index 8093954..7d01179 100644 --- a/docs/CURRENT_STATE.md +++ b/docs/CURRENT_STATE.md @@ -1,5 +1,7 @@ # Current state +FORGE-F018 is ready for Captain review on local `codex`. Forge discovers 12 implemented skills, including nine imported specialist packages, and one reserved package. The seven missing BortStack references remain a separate packaging issue. + FORGE-F017 is Complete on local `codex` following Captain acceptance on 2026-12-02. All 35 tests pass and both updated Codex skills match Forge. The ChatGPT project instructions remain available for separate manual application. FORGE-F016 is Complete on `codex` under FORGE-008; Captain accepted the focused Forge skill change on 2026-11-21. It addresses contributor application-delivery evidence in the canonical context and contributor skills. All 32 Forge tests and three skill package validations passed. No external application or installed skill was changed; live application/provider and JJ Windows exercises remain unverified. diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 56a676b..47ddd66 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -1,5 +1,7 @@ # Handoff +FORGE-F018 (2026-12-02): Nine reviewed specialist packages are ready for Captain review on `codex` from `31f8edf`. All 46 files match the archive. All 35 tests passed, and the unchanged validator and installer list/dry-run discovered all nine, for 12 implemented packages and one reserved. Installed skills were untouched. The seven missing BortStack references remain a separate packaging issue. Captain acceptance is pending. + FORGE-F017 closure (2026-12-02): Captain accepted the discussion-first protocol on local `codex` at `172ee63`. All 35 tests, three skill validations, task-ID audit, installer dry-run and diff checks passed. Both installed Codex skills match Forge. Previous copies remain backed up. Live conversational behavior and Windows remain unverified. Applying the project instructions in ChatGPT settings is a separate manual action. FORGE-F016 (2026-11-21): Captain accepted the focused Forge skill change through “task complete.” Direct `codex` implementation from `835a164` is recorded in commit `7365d3c`; the prior handoff update is `26774f4`. The central failure was standalone previews being accepted as application features. Context owns destination and integration evidence gates; contributor owns architecture discovery, real-route testing and plain-language guidance. The 18-scenario disposable fixture is in `docs/validation/application-delivery.md`; `tests/test_application_delivery.py` models evidence decisions and existing Git tests cover preservation. All 32 Forge tests, three skill validations, isolated-destination installer dry-run, task ID audit, and `git diff --check` passed. No external application, existing worktree, installed skill, or production service changed. Live JJ/Windows and application/provider exercises remain unverified; no application integration is claimed. diff --git a/docs/TASKS.md b/docs/TASKS.md index 7822ace..8abc9e8 100644 --- a/docs/TASKS.md +++ b/docs/TASKS.md @@ -155,6 +155,12 @@ Implementation and validation (2026-12-01): Commit `b3999ce` applied the shared Closure (2026-12-02): Captain accepted through “task complete.” Verified local `codex` at `172ee63` with 35 passing tests, three valid skill packages, task-ID audit, installer dry-run and diff check. The two installed Codex skills were updated separately at Captain direction and match Forge. The previous copies remain backed up. Live conversational and Windows checks remain unverified. Applying the project instructions in ChatGPT settings remains a separate manual action. +## FORGE-F018 — Import Reviewed Specialist Skill Packages + +Status: Ready for Review on local `codex`. Captain acceptance pending. Baseline: `31f8edf` under FORGE-008. + +Imported all 46 archive files across nine specialist packages, including references, agent metadata and icons. File contents match the reviewed archive byte for byte. Forge validated all 12 implemented packages, listed them and included them in an installer dry-run against a disposable destination. All 35 tests and the task ID audit passed. Installed skills were untouched. Windows installation and live skill activation were outside this validation. The seven missing BortStack references remain a separate packaging issue. + ## Scheduling diff --git a/skills/code-review/SKILL.md b/skills/code-review/SKILL.md new file mode 100644 index 0000000..4798632 --- /dev/null +++ b/skills/code-review/SKILL.md @@ -0,0 +1,351 @@ +--- +name: code-review +description: Use when Codex needs to review an existing branch, commit range, pull request, patch, staged changes, or working-tree diff for correctness, regressions, security, authorization, API/data-contract, migration, runtime, test-coverage, and maintainability risks. Inspect repository context and surrounding code, verify findings before reporting them, prioritize issues by severity and user impact, avoid cosmetic/style nitpicks, and do not modify code unless the user explicitly asks for fixes. +--- + +# Code Review + +Version: **2.0**. + +Review code for **real engineering risk**, not stylistic preference. Ground every finding in the actual diff plus enough surrounding repository evidence to establish that the change can cause a bug, regression, security weakness, contract break, data problem, runtime failure, or material maintainability hazard. + +This skill is designed to compose with `bortstack-context`. The context skill owns repository/task/decision/handoff semantics; this skill owns review methodology. Use `production-readiness-review` for a broad system-wide readiness audit rather than a bounded change review, `webapp-debug` when a reported runtime defect needs root-cause investigation, and `safe-refactor` when the goal is to change structure while preserving behavior. + +## Repository workflow + +In a BortStack project, use `bortstack-context` with the applicable repository `AGENTS.md` before task work. They govern scope and authorisation, branch/worktree policy, lifecycle, manual acceptance, and handoff. Find the maintained overview, current state, decisions, task and handoff records through repository instructions and layout. Use the paths and task IDs the project already uses. Follow context's canonical discussion, mission and lifecycle guidance when interpreting authority or changing task status. If a required BortStack skill is unavailable, report the dependency. If an installed skill lacks a required reference, use the reference from a verified Forge package with a matching manifest. If the required guidance is unavailable, pause the affected action. + +For edits, inspect Git status and worktrees, confirm authorised scope and the source candidate, and follow the current branch policy. Use direct integration-branch work where authorised and a dedicated branch/worktree where required. Preserve unrelated work. Read-only specialist work does not require a new worktree. When acting as an authorised contributor, use `bortstack-contributor` for contributor permissions, finalisation and submission. For ordinary specialist work, use the project's normal authority. + +When manual testing is relevant, discover the documented commands, configuration and hooks in the target repository. Use its supported workflow, including an existing `testtask` wrapper and its project-specific config or hook where documented. Preserve a working adapter and its supported invocation. Before use, inspect its supported arguments, candidate handling, runtime and cleanup behavior. If no adapter is required, use the established development environment. Record candidate identity, actual checks, limitations and pending human acceptance in the project's handoff. Refresh stale candidates after edits and make fixes in the authoritative source. A source snapshot, wrapper, automated check or startup alone does not establish a manual pass. Follow context and repository rules for task transitions and closure. + +Outside BortStack, follow the repository's own scope, branch, test and reporting conventions and proceed with the specialist workflow. BortStack skills and records are optional there. + +## Core rules + +1. **Read repository instructions and context first.** Obey root/nested `AGENTS.md`, accepted task scope, durable decisions, architecture conventions, validation requirements, and review-specific repository rules. +2. **Review the actual change set.** Establish exactly what is being reviewed: working tree, staged changes, branch-vs-base, commit range, PR patch, or supplied diff. Do not review an imagined change. +3. **Inspect surrounding code before raising findings.** A suspicious diff line is not enough. Check callers, routes/components, models, migrations, auth helpers, tests, configuration, and contracts needed to prove the issue. +4. **Prioritize correctness and risk.** Focus on bugs, regressions, security/auth problems, broken data/API contracts, migration hazards, concurrency/transaction issues, runtime/deployment failures, and missing tests for meaningful behavior. +5. **Do not nitpick style.** Avoid comments about formatting, naming taste, import order, minor duplication, or subjective aesthetics unless they create a concrete maintainability or correctness risk. +6. **Do not report hypothetical findings as defects.** A finding must have a plausible execution path and repository evidence. Distinguish confirmed issue, likely issue needing verification, and non-finding. +7. **Respect accepted behavior.** Do not label deliberate behavior a bug merely because another design would be preferable. Check project decisions and existing tests first. +8. **Review across layers.** For React + Flask applications, follow changes through UI/state -> request -> route/auth/validation -> domain/model -> persistence -> response -> UI handling when relevant. +9. **Treat authentication/authorization as server-side contracts.** Verify protected actions are enforced on the backend; UI hiding alone is not authorization. +10. **Treat migrations/data changes as high-risk.** Check upgrade/downgrade safety, defaults/nullability, backfills, constraints, indexes, data compatibility, and deployment ordering where relevant. +11. **Check failure paths, not only happy paths.** Errors, retries, partial failures, missing data, invalid input, unauthenticated/unauthorized access, and stale state often expose regressions. +12. **Use tests as evidence, not proof by existence.** Inspect whether tests actually exercise the changed behavior and would fail for the identified regression. +13. **Run focused validation when practical.** Tests/lint/build/static checks can strengthen or falsify review findings. Do not claim commands were run when they were not. +14. **Do not modify code by default.** A review is read-only unless the user explicitly asks to fix findings. Do not commit, push, merge, rebase, deploy, switch branches, or alter production state. +15. **Keep findings concise and actionable.** Explain what breaks, under what conditions, why the diff causes it, and what area needs correction. Do not prescribe a large redesign unless necessary. +16. **No-padding rule.** If the change is sound, say so. Do not invent low-value findings to make the review look substantial. + +## Establish review scope + +Before reviewing, determine: + +- repository/project identity; +- current branch and working-tree state when available; +- exact base/target or commit range; +- accepted task or feature represented by the change; +- files changed; +- relevant durable decisions and contracts; +- whether generated/vendor/lock files should be reviewed or mostly excluded; +- expected validation commands; +- whether the user requested review only or review plus fixes. + +If the intended base is ambiguous and choosing the wrong one could materially change the review, resolve it from repository metadata/context where possible. Ask only when it cannot be determined safely. + +Review the exact requested candidate against its documented base and acceptance criteria. For direct-branch work, use its recorded starting commit and scoped changes. Include intended untracked files when reviewing a working tree. Flag stale test evidence and unrelated changes. + +## 1. Read the change set before deep-diving + +Inspect the diff/patch and classify changed areas, for example: + +- models/schema/migrations; +- Flask routes/services/auth; +- React components/hooks/state; +- API client/contracts; +- configuration/environment/runtime; +- tests/fixtures; +- Docker/CI/deployment; +- documentation/context only. + +Identify high-risk edits first: authorization changes, destructive data operations, changed routes/status codes, token/session handling, migrations, transaction behavior, concurrency, external side effects, configuration defaults, and removed validation. + +Do not infer intent solely from commit messages. Compare the diff with accepted task/context evidence and current code. + +## 2. Verify behavior and contracts around each risky change + +For each material edit, trace enough surrounding code to answer: + +- Who calls this changed code? +- What inputs can reach it? +- Which auth/authorization checks guard it? +- What data does it read/write? +- What errors/status codes are observable? +- What state transitions or side effects occur? +- Which existing contracts depend on the old behavior? +- Do frontend and backend expectations still match? +- Are existing tests sufficient to detect regression? + +Search for all important symbol/path/config references before concluding a rename/removal is safe or broken. + +## 3. Review by risk category + +### Correctness and regressions + +Look for: + +- changed conditionals that invert/skip behavior; +- missing edge-case handling; +- stale state/closure issues; +- incorrect default/null/empty handling; +- wrong ordering/filtering/pagination semantics; +- off-by-one/date/time/timezone errors; +- duplicated or omitted side effects; +- changed error/status behavior; +- caller/callee signature mismatches; +- removed compatibility behavior still used elsewhere. + +A finding should identify the concrete path by which behavior breaks. + +### Authentication and authorization + +Check: + +- unauthenticated handling; +- role/ownership/tenant checks; +- object-level authorization; +- token/session refresh/revocation behavior; +- server-side enforcement for privileged actions; +- information disclosure through errors or list/detail endpoints; +- accidental weakening caused by helper/decorator changes. + +Do not treat frontend route guards or hidden controls as sufficient authorization. + +### Input validation and API contracts + +Check: + +- required/optional fields; +- type/range/format constraints; +- unknown or extra fields if contract-sensitive; +- request/response field names; +- status/error shapes; +- pagination/filter/sort semantics; +- null/empty behavior; +- backwards compatibility with existing clients; +- serialization/deserialization changes. + +### Database, migrations, and transactions + +Inspect both model changes and migration files. Check: + +- upgrade and downgrade coherence; +- nullable/non-null transitions; +- defaults and server defaults; +- existing-row compatibility/backfills; +- foreign keys/cascades/uniqueness; +- index additions/removals; +- enum/value compatibility; +- migration ordering/dependencies; +- transaction boundaries/rollback behavior; +- race conditions around uniqueness/availability/counters; +- data loss or irreversibility. + +Do not assume an ORM model change is safe because the migration file exists. + +### React/frontend behavior + +Check: + +- route/navigation compatibility; +- prop/context/hook contracts; +- state initialization and updates; +- async race/stale response handling; +- loading/error/empty/success states; +- form payload construction and validation; +- auth/session handling; +- accessibility regressions caused by interaction changes; +- API response assumptions; +- cleanup of timers/listeners/effects where behaviorally relevant. + +Do not submit purely subjective visual-design feedback in a code review unless the accepted task includes visual requirements or the diff causes a concrete usability/accessibility defect. + +### Runtime/configuration/deployment + +Check: + +- environment variable/key renames; +- unsafe/default configuration changes; +- startup/import paths; +- Docker build/runtime assumptions; +- nginx/SWAG/Gunicorn wiring; +- CI commands and version requirements; +- secret exposure; +- migration/deploy ordering; +- health checks/ports/volumes/network names when changed. + +Treat runtime contracts as public interfaces when production depends on them. + +### Security beyond auth + +Look for concrete risks such as: + +- injection paths; +- unsafe file/path handling; +- secret/token leakage; +- overly broad CORS or trust settings; +- CSRF/session regressions where applicable; +- insecure redirects/URL handling; +- unsafe deserialization; +- sensitive data in logs/errors; +- privilege escalation; +- missing rate/abuse controls only when the changed code creates or materially worsens the exposure. + +Avoid generic security boilerplate unrelated to the diff. + +## 4. Review tests as part of the change + +Ask whether changed behavior has adequate regression coverage. + +High-value missing-test findings include: + +- new privileged endpoint without non-admin/unauthenticated tests; +- changed validation without invalid-boundary tests; +- migration with no upgrade/data-compatibility check where repository practice expects one; +- bug fix with no regression test; +- changed refresh/retry/error behavior without coverage; +- new branching logic where only happy path is tested. + +Do not require a test for every trivial line. Missing tests should be reported when they leave a meaningful behavior/regression unprotected. + +## 5. Validate findings where practical + +Use focused commands to confirm/falsify suspected issues when the environment allows, such as: + +- a relevant pytest/Vitest test file; +- a small existing reproduction test; +- lint/type/build checks; +- migration inspection/upgrade in a disposable database; +- grep/search for callers/references; +- static config validation. + +Do not mutate production or introduce broad fixture/data changes solely to prove a review point. + +If validation is blocked, state the limitation and keep the finding proportional to the evidence. + +## 6. Severity model + +Use repository-specific severity conventions if they exist. Otherwise use: + +### Critical + +Likely severe security compromise, irreversible/catastrophic data loss, or production-wide outage with a realistic path. + +### High + +Material security/authorization failure, data corruption/loss, broken core workflow, migration/deployment failure, or broad regression likely to affect users. + +### Medium + +Real functional defect affecting a narrower path, edge case, reliability, or important maintainability issue with credible future failure risk. + +### Low + +Minor but concrete defect with limited impact. Use sparingly. + +Do **not** assign severity merely based on how much code is involved. Severity reflects impact and likelihood. + +If the repository uses P0/P1/etc. for implementation priority, do not automatically map review severity to those task priorities unless its conventions explicitly define that mapping. + +## 7. Evidence standard for a finding + +Every reported finding should contain enough information to answer: + +1. **Where is the problem?** File/area and changed behavior. +2. **What breaks?** Concrete consequence. +3. **When does it break?** Input/state/runtime condition. +4. **Why does this change cause it?** Repository evidence and execution path. +5. **How confident are we?** Confirmed by code/tests/runtime, or limited by environment. + +Avoid speculative phrasing such as "might be insecure" without tracing a credible path. + +If further evidence disproves a suspected issue, drop it from the final review. + +## 8. Review-only behavior + +Unless the user explicitly asks for fixes: + +- do not edit application files; +- do not add tests; +- do not update context docs merely because findings exist; +- do not create tasks automatically; +- do not alter task status; +- do not commit/push/comment on external PRs. + +In BortStack projects, findings can be proposed for context/task treatment, but accepted task creation remains governed by that system and user/repository conventions. + +If the user asks to **review and fix**, first complete the review enough to establish the issues, then apply the appropriate implementation/debug/refactor workflow. Keep review findings and changes clearly distinguishable. + +## 9. Handling an empty or clean review + +A valid review can result in **no findings**. + +If no material issue is found: + +- say that no actionable correctness/security/regression findings were identified; +- summarize what areas were inspected; +- report validation actually run; +- state relevant limitations; +- do not manufacture style comments or speculative edge cases. + +## 10. Context-system interaction + +In BortStack projects: + +- read project context before judging intent/accepted behavior; +- respect ADR/PDR/task constraints; +- use the project’s current-state record as evidence of known issues, but verify whether the diff affects them; +- do not turn every review finding into authorised implementation work; +- do not rewrite the project’s handoff record during a review-only task unless explicitly requested or repository rules require it; +- if a finding exposes stale context, report the mismatch and let the context workflow reconcile it appropriately. + +## Completion report + +Lead with findings, ordered from highest to lowest severity. For each finding include: + +- severity; +- concise title; +- affected file/area; +- concrete failure/risk; +- triggering conditions; +- supporting evidence; +- validation status/limitations where relevant. + +Then include a short review summary: + +- change set reviewed; +- repository/context evidence inspected; +- validation run; +- areas not verified; +- whether context/tasks were changed (normally no for review-only work). + +Do not bury important findings below a long narrative. Do not repeat the same root cause as multiple findings unless the consequences are genuinely independent. + +## When not to use this skill + +Do not use this workflow for: + +- broad production-readiness auditing across the whole system — use `production-readiness-review`; +- diagnosing an already observed runtime bug whose root cause is unknown — use `webapp-debug`; +- implementing a new accepted feature — use `webapp-feature`; +- behavior-preserving restructuring — use `safe-refactor`; +- visual/browser QA of rendered application behavior — use `frontend-visual-qa`; +- deployment execution/checklists — use `deployment-check`. + +## Resources + +- `references/review-checklist.md` — concise cross-layer review checklist. +- `references/finding-quality.md` — evidence and severity checklist for high-signal review findings. diff --git a/skills/code-review/agents/openai.yaml b/skills/code-review/agents/openai.yaml new file mode 100644 index 0000000..0a83161 --- /dev/null +++ b/skills/code-review/agents/openai.yaml @@ -0,0 +1,18 @@ +interface: + display_name: code review + short_description: Use when Codex needs to review an existing branch, commit range, + pull request, patch, staged changes, or working-tree diff for correctness, regressions, + security, authorization, API/data-contract, migration, runtime, test-coverage, + and maintainability risks. Inspect repository context and surrounding code, verify + findings before reporting them, prioritize issues by severity and user impact, + avoid cosmetic/style nitpicks, and do not modify code unless the user explicitly + asks for fixes. + icon_small: assets/icon.svg + icon_large: assets/icon.svg +policy: + products: + - chatgpt + - codex + - api + - atlas + allow_implicit_invocation: true diff --git a/skills/code-review/assets/icon.svg b/skills/code-review/assets/icon.svg new file mode 100644 index 0000000..c782ded --- /dev/null +++ b/skills/code-review/assets/icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/skills/code-review/references/finding-quality.md b/skills/code-review/references/finding-quality.md new file mode 100644 index 0000000..7a05beb --- /dev/null +++ b/skills/code-review/references/finding-quality.md @@ -0,0 +1,49 @@ +# Finding Quality and Severity + +Before reporting a finding, verify: + +## Evidence +- Is the issue caused or exposed by the reviewed change? +- Is there a concrete execution/data/runtime path? +- Did you inspect enough surrounding code to rule out an existing guard/helper? +- Is the behavior actually contrary to repository requirements/tests/decisions? +- Can the condition occur with realistic inputs/state? + +If any answer is unknown, gather more evidence or lower confidence. Do not present speculation as fact. + +## Good finding structure + +**[Severity] Short title** — `file/area` + +Explain the failure in one compact paragraph: the triggering condition, observed consequence, and why the changed code permits it. Mention validation evidence or limitations where useful. + +## Severity prompts + +### Critical +- Realistic severe compromise? +- Irreversible/catastrophic data loss? +- Production-wide outage with a direct path? + +### High +- Authorization/security bypass? +- Data corruption/loss? +- Core workflow broken for common inputs? +- Migration/deployment likely to fail broadly? + +### Medium +- Real but narrower functional/reliability defect? +- Edge case that affects legitimate users/data? +- Maintainability flaw with a concrete near-term failure mode? + +### Low +- Minor concrete defect with limited user/operational impact? + +Do not use severity as implementation priority unless repository conventions explicitly map the two. + +## Reject these weak findings +- Pure naming/style preference. +- "Could maybe fail" without a path. +- Generic security advice unrelated to the diff. +- Existing behavior unchanged by the patch, unless the patch newly relies on it in an unsafe way. +- Missing tests for trivial implementation details. +- A design alternative presented as a correctness bug. diff --git a/skills/code-review/references/review-checklist.md b/skills/code-review/references/review-checklist.md new file mode 100644 index 0000000..42c8b60 --- /dev/null +++ b/skills/code-review/references/review-checklist.md @@ -0,0 +1,57 @@ +# Code Review Checklist + +Use selectively based on the diff. Do not turn this into a mechanical list of comments. + +## Scope and context +- Confirm branch/base/commit range or exact working-tree diff. +- Read repository instructions/context and accepted task intent. +- Identify high-risk changed areas first. + +## Correctness +- Trace changed conditionals and state transitions. +- Check edge/null/empty/error cases. +- Check changed callers and public contracts. +- Verify retries/side effects are not duplicated or skipped. + +## Auth/security +- Backend authentication present where required. +- Role/ownership/object authorization preserved. +- No secrets/sensitive data leaked. +- No obvious injection/path/redirect/deserialization exposure introduced. + +## API/data contracts +- Request/response/status shapes remain coherent. +- Frontend/backend field expectations match. +- Validation covers boundaries and malformed input. +- Pagination/filter/order/date semantics remain stable. + +## Database/migrations +- Model and migration agree. +- Existing rows survive new constraints/defaults. +- FK/unique/index/cascade semantics are intentional. +- Upgrade/deployment order is safe. +- Downgrade is coherent where repository practice requires it. + +## Frontend +- Props/context/hook contracts preserved. +- Async state handles race/error/loading paths. +- Forms send correct payloads. +- Route/navigation/auth behavior remains correct. +- Interaction changes do not create obvious accessibility regressions. + +## Runtime/config +- Env/config names and defaults remain compatible. +- Entry points/imports/startup commands still work. +- Docker/CI/deployment wiring matches changed paths/dependencies. +- No secret committed or logged. + +## Tests +- Meaningful changed behavior has regression coverage. +- Negative/auth/error paths are tested where risk warrants it. +- Tests would actually fail for the suspected regression. + +## Final signal check +- Remove speculative or stylistic findings. +- Merge duplicates sharing one root cause. +- Order findings by severity/impact. +- It is acceptable to return no findings. diff --git a/skills/deployment-check/SKILL.md b/skills/deployment-check/SKILL.md new file mode 100644 index 0000000..14234f5 --- /dev/null +++ b/skills/deployment-check/SKILL.md @@ -0,0 +1,293 @@ +--- +name: deployment-check +description: Safely preflight, execute, verify, or assess a web-app deployment using repository and runtime evidence. Check release artifacts, configuration/secrets, migrations, containers/processes, reverse proxy/TLS, health, logs, smoke tests, backup/rollback readiness, and release recording. Production mutation requires explicit user authorization; stop on failed gates instead of improvising. +--- + +# Deployment Check + +Version: **2.0**. + +Use this skill when the user asks to prepare for, validate, perform, verify, troubleshoot, or roll back a deployment of a web application. + +This skill is narrower than a production-readiness review. It answers: **can this specific release be deployed safely, and did the deployment actually succeed?** + +## Repository workflow + +In a BortStack project, use `bortstack-context` with the applicable repository `AGENTS.md` before task work. They govern scope and authorisation, branch/worktree policy, lifecycle, manual acceptance, and handoff. Find the maintained overview, current state, decisions, task and handoff records through repository instructions and layout. Use the paths and task IDs the project already uses. Follow context's canonical discussion, mission and lifecycle guidance when interpreting authority or changing task status. If a required BortStack skill is unavailable, report the dependency. If an installed skill lacks a required reference, use the reference from a verified Forge package with a matching manifest. If the required guidance is unavailable, pause the affected action. + +For edits, inspect Git status and worktrees, confirm authorised scope and the source candidate, and follow the current branch policy. Use direct integration-branch work where authorised and a dedicated branch/worktree where required. Preserve unrelated work. Read-only specialist work does not require a new worktree. When acting as an authorised contributor, use `bortstack-contributor` for contributor permissions, finalisation and submission. For ordinary specialist work, use the project's normal authority. + +When manual testing is relevant, discover the documented commands, configuration and hooks in the target repository. Use its supported workflow, including an existing `testtask` wrapper and its project-specific config or hook where documented. Preserve a working adapter and its supported invocation. Before use, inspect its supported arguments, candidate handling, runtime and cleanup behavior. If no adapter is required, use the established development environment. Record candidate identity, actual checks, limitations and pending human acceptance in the project's handoff. Refresh stale candidates after edits and make fixes in the authoritative source. A source snapshot, wrapper, automated check or startup alone does not establish a manual pass. Follow context and repository rules for task transitions and closure. + +Outside BortStack, follow the repository's own scope, branch, test and reporting conventions and proceed with the specialist workflow. BortStack skills and records are optional there. + +## Related skills + +- use `production-readiness-review` for broad launch readiness rather than a specific release operation; +- use `webapp-debug` if a post-deploy failure needs root-cause investigation rather than deployment gating. + +Do not redefine the repository's task, decision, branch, or deployment conventions. + +## Core principle + +Deployment is a sequence of **gates**, not a script to force through. + +At every stage ask: + +- Do we know exactly what release is being deployed? +- Are configuration, secrets, data, and dependencies ready for that release? +- Is the migration path safe and recoverable? +- Can the release be verified from the user-facing path? +- Can we return to a known-good state if verification fails? + +If a required gate fails, **stop**. Do not improvise destructive workarounds merely to get a green deployment. + +## Deployment modes + +Determine the requested mode from the user's instruction. + +### Preflight + +Read-only assessment before deployment. Verify readiness of the specific release and identify blockers. Do not mutate production. + +### Execute + +Perform the deployment only when the user has explicitly requested deployment and the required production access is available. Mutation is limited to the approved deployment scope. + +### Verify + +Inspect an already-performed deployment using health, logs, smoke tests, release identity, proxy/TLS, and data/migration evidence. Avoid unrelated changes. + +### Rollback / recovery + +Use only when explicitly requested or when the deployment plan already authorizes an automatic rollback on failed verification. Prefer the documented release-specific rollback path. Never invent rollback commands against production data. + +If the user's request is ambiguous between checking and deploying, default to **Preflight**. + +## Mutation authorization gate + +Read the repository’s merge, release and deployment authority rules and identify the exact authorised artifact before acting. Successful source checks do not grant deployment authority. + +Repository inspection, local validation, reading logs, and non-destructive health/smoke requests are normally safe. + +Before any action that changes production state, confirm that the current user request explicitly authorizes that class of action. Examples include: + +- pulling/restarting production containers; +- changing Compose/systemd/Kubernetes state; +- applying database migrations to production; +- updating a release/image reference; +- changing proxy configuration; +- changing DNS/TLS; +- rotating secrets; +- restoring a database; +- rollback to another release. + +Authorization to "check deployment" is **not** authorization to deploy. Authorization to deploy application containers is **not** automatically authorization to change DNS, rotate credentials, or restore data. + +Do not commit, push, merge, or switch branches unless the user explicitly requests it and repository rules permit it. + +## Workflow + +### 1. Establish release identity and topology + +Read repository context and inspect deployment-relevant files. Determine, where evidence permits: + +- source commit / tag / release ID; +- image name, tag, and preferably immutable digest; +- frontend/backend/database services; +- database engine and migration mechanism; +- production Compose/Kubernetes/systemd topology; +- reverse proxy and TLS termination; +- secrets/config source; +- persistent volumes/data paths; +- health/readiness mechanism; +- backup/recovery mechanism; +- expected external services; +- rollback method and previous known-good release. + +Never deploy an unidentified working tree or ambiguous mutable artifact when the project requires immutable releases. + +### 2. Preflight the release + +Use `references/deployment-gates.md` as the coverage guide. + +At minimum, verify the applicable gates: + +- repository/Git state matches the intended release; +- required CI/build/test gates are satisfied or freshly rerun where practical; +- release artifacts exist and correspond to the intended source; +- runtime versions are supported; +- production config contains required keys without exposing secret values; +- no development/debug configuration is accidentally enabled; +- target ports/networks/volumes are coherent; +- database connectivity assumptions and migration head are known; +- destructive/irreversible migration risks are identified; +- current backup/recovery evidence is adequate for the planned data change; +- proxy/TLS hostnames and routing expectations are known; +- external dependencies required at startup/runtime are understood; +- disk/resource capacity has no obvious blocker when runtime access permits checking it; +- rollback target/procedure exists before changing production. + +A successful syntax check is not sufficient if critical release identity, migration, or recovery gates are unknown. + +### 3. Validate configuration without leaking secrets + +Inspect names/presence/types and safe metadata only. + +Do not echo secret contents into the response. When needed, report: + +- missing key; +- unexpected source; +- empty value; +- malformed non-secret structure; +- permission/ownership issue; +- environment mismatch. + +Use repository examples/schema/config code to determine requirements rather than guessing. + +### 4. Treat database migrations as a separate gate + +Use `references/migration-safety.md` to evaluate migration ordering, compatibility, backup and recovery. + +Before production migration, inspect the actual migration(s) between current and target revisions. + +Check for risks such as: + +- drops/renames that lose data; +- non-null columns without safe population/default strategy; +- type conversions; +- uniqueness/foreign-key additions against existing data; +- long table rewrites/locks; +- data backfills mixed into schema change; +- one-way migrations that make application rollback unsafe; +- mismatch between application and migration release ordering. + +Where supported, validate on a disposable/restored database first. + +Do not rewrite existing production migration history to simplify deployment. + +### 5. Execute only the documented minimal release change + +In Execute mode, prefer project-defined scripts/workflows over ad-hoc commands. + +Typical safe ordering may be: + +1. capture current release identity and runtime state; +2. confirm recent backup/recovery gate if data changes require it; +3. fetch/pull the exact approved artifact; +4. run migration at the documented point in the release sequence; +5. replace/restart only intended services; +6. wait for health/readiness; +7. verify through the real proxy/user-facing path; +8. inspect relevant logs; +9. record the exact deployed release. + +But always follow repository-specific deployment order when it differs. + +Avoid `latest`-style ambiguity when immutable tags/digests are available. + +### 6. Verify the deployed release + +Verification must go beyond "container is running". + +Where applicable, verify: + +- deployed image/release identity matches the approved artifact; +- container/process state and restart loops; +- application liveness/readiness; +- database migration revision; +- user-facing HTTPS endpoint through the real reverse proxy; +- TLS certificate/hostname behavior; +- authentication/session path if safe test credentials exist; +- one or more critical read/write smoke paths appropriate to the app; +- static assets/frontend API routing; +- external service behavior needed for core flows; +- recent error/warning logs; +- backup/monitoring jobs remain healthy after deployment. + +Do not create real customer/user data for smoke tests unless the project has an approved test mechanism. + +### 7. Decide success, stop, or rollback + +Use one of these deployment outcomes: + +- **Pass** — all required gates and post-deploy verification succeeded. +- **Pass with conditions** — deployment is functioning, but explicit non-blocking limitations remain. +- **Stop before deployment** — a preflight gate failed; production was not changed. +- **Deployment failed — rollback required** — production changed and required verification failed, with a known rollback path available. +- **Deployment state uncertain** — evidence/access is insufficient to determine a safe state; avoid further mutation until state is established. + +If rollback is required and authorized, use the known previous release and documented data compatibility rules. If database migration makes rollback unsafe, do not pretend application-only rollback is sufficient. + +### 8. Update context after an authorized deployment + +In BortStack projects, preserve durable deployment facts when appropriate, such as: + +- exact deployed release/digest; +- validation result; +- new verified production state; +- blocker/failure discovered; +- rollback performed; +- task completion/blocking state; +- concise next-session handoff. + +Do not store credentials, secret values, or noisy transient logs in context documentation. + +Do not mark a deployment task Complete if required verification was blocked or failed. + +## Failure handling rules + +- Stop on an unexpected migration state before applying new migrations. +- Stop when the artifact does not match the intended release. +- Stop when required secrets/config are missing or ambiguous. +- Stop when there is no acceptable rollback/recovery path for a risky data change. +- Stop on failing health/readiness instead of hiding it with longer arbitrary sleeps. +- Inspect logs/evidence before restarting repeatedly. +- Do not disable TLS verification, auth, health checks, migrations, tests, or security controls merely to complete a deployment. +- Do not delete volumes, databases, caches, certificates, or release history unless the user explicitly authorizes the specific destructive action. + +## Output format + +For Preflight, start with one of: + +- **Ready to deploy** +- **Ready to deploy with conditions** +- **Stop before deployment** +- **Preflight incomplete** + +For Execute/Verify, start with one of: + +- **Deployment passed** +- **Deployment passed with conditions** +- **Deployment failed — rollback required** +- **Deployment state uncertain** + +Then report: + +1. release identity and target environment; +2. repository/runtime/deployment evidence inspected; +3. preflight gate results; +4. actions actually performed (if any); +5. database/migration result; +6. service/container/process state; +7. proxy/TLS/health/smoke results; +8. relevant log findings; +9. rollback/recovery readiness or action; +10. validation limitations/unverified assumptions; +11. context/task updates made, if any; +12. exact recommended next action. + +When useful, present gates as a concise table with **Pass / Fail / Blocked / Not applicable / Not verified**. + +## Completion criteria + +A deployment check is complete only when: + +1. the intended release and environment are unambiguous; +2. applicable preflight gates were checked against real evidence; +3. production mutation, if any, was explicitly authorized; +4. migration/data risk was considered separately; +5. post-deploy verification used the real runtime/user-facing path where available; +6. release identity and rollback state are known; +7. failures/unknowns are reported honestly rather than worked around speculatively; +8. the final deployment outcome matches the evidence. diff --git a/skills/deployment-check/agents/openai.yaml b/skills/deployment-check/agents/openai.yaml new file mode 100644 index 0000000..d473f29 --- /dev/null +++ b/skills/deployment-check/agents/openai.yaml @@ -0,0 +1,16 @@ +interface: + display_name: deployment check + short_description: Safely preflight, execute, verify, or assess a web-app deployment + using repository and runtime evidence. Check release artifacts, configuration/secrets, + migrations, containers/processes, reverse proxy/TLS, health, logs, smoke tests, + backup/rollback readiness, and release recording. Production mutation requires + explicit user authorization; stop on failed gates instead of improvising. + icon_small: assets/icon.svg + icon_large: assets/icon.svg +policy: + products: + - chatgpt + - codex + - api + - atlas + allow_implicit_invocation: true diff --git a/skills/deployment-check/assets/icon.svg b/skills/deployment-check/assets/icon.svg new file mode 100644 index 0000000..f19f1b6 --- /dev/null +++ b/skills/deployment-check/assets/icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/skills/deployment-check/references/deployment-gates.md b/skills/deployment-check/references/deployment-gates.md new file mode 100644 index 0000000..2f94890 --- /dev/null +++ b/skills/deployment-check/references/deployment-gates.md @@ -0,0 +1,74 @@ +# Deployment Gates + +Use this as a coverage guide. Apply only gates relevant to the repository/deployment model. + +## Release identity +- Intended source commit/tag/release known +- Working tree/release source acceptable under repository rules +- Built artifact/image maps to intended source +- Immutable tag/digest available when project requires it +- Previous known-good release identified + +## Validation +- Required CI gates passed +- Relevant backend tests passed +- Relevant frontend tests passed +- Lint/static checks passed or accepted findings documented +- Production build succeeds +- Container/config syntax validation succeeds + +## Runtime/config +- Supported runtime versions +- Required environment keys present +- Production mode/debug settings correct +- Secrets sourced from approved location +- No secret values printed into logs/report +- Networks, ports, volumes and permissions coherent +- Resource/disk capacity acceptable where verifiable + +## Database/migrations +- Current revision known +- Target revision known +- Migration delta inspected +- Existing-data constraints considered +- Lock/downtime risk considered +- Backup/recovery gate appropriate to migration risk +- Rollback compatibility understood +- Migration validated on disposable/restored DB where feasible + +## Artifact/container/process +- Exact image/package exists +- Image architecture/runtime compatible +- Pull/build succeeds +- Services start without restart loop +- Health/readiness becomes healthy +- Persistent volumes remain mounted correctly + +## Reverse proxy/TLS +- Expected hostname known +- Proxy routes to correct service/port/network +- HTTPS works through the real public/internal entry point +- Certificate valid for hostname +- HTTP→HTTPS behavior correct where intended +- Forwarded headers/proxy trust match app assumptions + +## Smoke tests +- Landing/API health path +- Authentication path when safe test account exists +- Core protected read path +- Core write path only when approved safe test mechanism exists +- Frontend static assets/API requests +- Critical external service where required + +## Logs/observability +- No new fatal/repeated error pattern +- App/proxy/database logs checked where available +- Monitoring/alerts remain active +- Backup timer/job still healthy + +## Rollback/recovery +- Previous release known +- Command/workflow documented +- Application rollback compatible with new schema +- Data restore authority and backup location known for destructive failure +- Exact deployed release recorded diff --git a/skills/deployment-check/references/migration-safety.md b/skills/deployment-check/references/migration-safety.md new file mode 100644 index 0000000..9d98b0e --- /dev/null +++ b/skills/deployment-check/references/migration-safety.md @@ -0,0 +1,22 @@ +# Migration Safety Notes + +Treat migrations as a production data operation, not merely part of container startup. + +Before applying a migration, inspect the revisions between current and target state. Pay special attention to: + +- dropping tables/columns/indexes/constraints; +- renaming without compatibility window; +- adding required columns to populated tables; +- new unique constraints over existing data; +- foreign keys with orphaned historical rows; +- enum/type narrowing or conversion; +- large backfills or full-table rewrites; +- long-running DDL/lock behavior; +- application versions that cannot operate before/after the migration; +- downgrade steps that do not restore lost data. + +Prefer expand/migrate/contract patterns for changes that must support rolling or reversible deployments. + +A syntactically valid migration is not proof that it is safe against production data. + +If migration validation cannot be performed, report the exact uncertainty and do not call the data gate passed. diff --git a/skills/frontend-ui-design/SKILL.md b/skills/frontend-ui-design/SKILL.md new file mode 100644 index 0000000..2fba857 --- /dev/null +++ b/skills/frontend-ui-design/SKILL.md @@ -0,0 +1,476 @@ +--- +name: frontend-ui-design +description: Specify implementation-level layout, information hierarchy, interactions, components, responsive behavior and UI states within an approved web design direction. Use existing design systems and component patterns, including React-Bootstrap when present. Route BortStack concept exploration, design approval and design handoff to bortstack-design, implementation to webapp-feature, and browser verification to frontend-visual-qa. +--- + +# Frontend UI Design + +Version: **2.0**. + +Design the user interface **before implementation interrupts the engineering flow**. Turn a feature/page requirement into an implementation-ready composition: information hierarchy, page regions, actions, responsive behavior, states, suitable reusable components, and accessibility/interaction expectations. + +Use `bortstack-design` for BortStack concepts, approval and design handoff. Use `webapp-feature` for authorised implementation and `frontend-visual-qa` for independent browser verification. For project scaffolding, use `roborto-new-project` as the temporary route. + +## Repository workflow + +In a BortStack project, use `bortstack-context` with the applicable repository `AGENTS.md` before task work. They govern scope and authorisation, branch/worktree policy, lifecycle, manual acceptance, and handoff. Find the maintained overview, current state, decisions, task and handoff records through repository instructions and layout. Use the paths and task IDs the project already uses. Follow context's canonical discussion, mission and lifecycle guidance when interpreting authority or changing task status. If a required BortStack skill is unavailable, report the dependency. If an installed skill lacks a required reference, use the reference from a verified Forge package with a matching manifest. If the required guidance is unavailable, pause the affected action. + +For edits, inspect Git status and worktrees, confirm authorised scope and the source candidate, and follow the current branch policy. Use direct integration-branch work where authorised and a dedicated branch/worktree where required. Preserve unrelated work. Read-only specialist work does not require a new worktree. When acting as an authorised contributor, use `bortstack-contributor` for contributor permissions, finalisation and submission. For ordinary specialist work, use the project's normal authority. + +When manual testing is relevant, discover the documented commands, configuration and hooks in the target repository. Use its supported workflow, including an existing `testtask` wrapper and its project-specific config or hook where documented. Preserve a working adapter and its supported invocation. Before use, inspect its supported arguments, candidate handling, runtime and cleanup behavior. If no adapter is required, use the established development environment. Record candidate identity, actual checks, limitations and pending human acceptance in the project's handoff. Refresh stale candidates after edits and make fixes in the authoritative source. A source snapshot, wrapper, automated check or startup alone does not establish a manual pass. Follow context and repository rules for task transitions and closure. + +Outside BortStack, follow the repository's own scope, branch, test and reporting conventions and proceed with the specialist workflow. BortStack skills and records are optional there. + +## Core operating rule + +Default to a read-only implementation specification. Start with the project's visual authority, such as approved design source/version, tokens, component and layout guides, and established screens. In BortStack, obtain the approved handoff or confirm a recorded, task-specific override through `bortstack-context` before design-dependent implementation. Route missing direction, material departures, concept alternatives and approval back to `bortstack-design`. A request to design and implement together still follows the project's approval and implementation gates. + +Outside BortStack, use the project's design and approval process. If there is no design system, use restrained local component and layout defaults within the user's agreed direction and surface decisions that need agreement. + +## Core rules + +1. **Read repository instructions and UI context first.** Obey `AGENTS.md`, maintained project records, task scope, approved screenshots/mockups, design-system docs, component-library docs, layout guides, existing pages, and repository conventions. +2. **Design around the user's task, not visual novelty.** Optimize clarity, hierarchy, usability, consistency, responsiveness, and implementation practicality. +3. **Extend before redesigning.** If the application already has an approved visual language, compose the new UI from it. Do not modernize or restyle the application without explicit authorization. +4. **Resolve local defaults within the approved direction.** Use restrained, conventional UI/UX patterns when that direction leaves an implementation detail open. +5. **Prefer existing components.** Reuse shared components and existing React-Bootstrap patterns before proposing new primitives. +6. **React-Bootstrap is the preferred foundation when the repository uses it.** Prefer its layout/form/navigation/feedback primitives and Bootstrap responsive conventions rather than recreating generic UI controls from scratch. +7. **Do not force Bootstrap aesthetics.** React-Bootstrap provides structure and behavior; the project's visual tokens, SCSS/modules, typography, colors, spacing, and established components define the application's identity. +8. **Design all relevant states.** Do not specify only the ideal populated state. Consider loading, empty, error, validation, success, disabled, permission, destructive-confirmation, and responsive states as applicable. +9. **Design responsive behavior explicitly.** State what changes at broad desktop, intermediate/tablet, and narrow/mobile widths where relevant. Do not rely on “Bootstrap will handle it”. +10. **Use semantic interaction patterns.** Buttons should be actions, links should navigate, fields should be labelled, destructive actions should be clear, and clickable containers should not substitute for proper controls without a justified pattern. +11. **Keep cognitive load low.** Prioritize primary actions and information. Do not expose every secondary option at equal visual weight. +12. **Choose patterns based on content and workflow.** Do not default everything to cards, tables, modals, dashboards, tabs, or sidebars. +13. **Avoid premature custom components.** Introduce a reusable component when repeated semantics/behavior justify it, not merely to reduce a few lines of JSX. +14. **Do not invent product behavior.** When the design depends on unresolved business rules, surface the decision rather than encoding an assumption into the UI. +15. **Accessibility is part of design.** Account for labels, keyboard use, focus, semantics, error communication, touch targets, content order, and non-color-only state cues from the outset. +16. **Keep implementation cost visible.** Prefer a simple composition that solves the task over an elaborate design with little user benefit. +17. **Do not commit, push, deploy, switch branches, or perform production actions unless explicitly requested.** +18. **Do not claim the design was visually verified.** That is `frontend-visual-qa`'s job after implementation. + +## Determine the design mode + +Use one of these modes based on repository evidence. + +### Extend mode + +Use when the project already has an established or approved UI language. + +Inspect and preserve: + +- page shell/container widths; +- navigation/header/footer patterns; +- typography hierarchy; +- spacing rhythm; +- color/theme tokens; +- button hierarchy; +- form conventions; +- cards/tables/lists; +- modal/offcanvas patterns; +- empty/loading/error conventions; +- responsive behavior; +- existing reusable components. + +The new page should look like it belongs to the same application. + +### Local defaults mode + +Use when the approved direction leaves component or layout details open. + +Specify only the local defaults needed for coherent implementation: + +- page container/gutter convention; +- heading hierarchy; +- primary/secondary/destructive action hierarchy; +- form treatment; +- content grouping; +- basic spacing rhythm; +- responsive composition; +- state-feedback conventions. + +Do not attempt to create an exhaustive design system unless asked. + +## 1. Understand the user's job-to-be-done + +Before drawing a layout in prose, determine: + +- who uses this page/feature; +- what they are trying to accomplish; +- the primary action; +- secondary actions; +- information required to make the action safely; +- information that is optional/contextual; +- frequency of use; +- whether users scan, compare, edit, create, monitor, or progress through a sequence; +- whether the flow is novice-oriented, expert/data-dense, or mixed; +- key constraints from task/decisions/backend domain. + +Do not start by choosing `Card`, `Table`, or `Modal`. Start with the user task and information hierarchy. + +## 2. Inspect the current frontend + +Read the relevant repository evidence, such as: + +- React routes and page components; +- shared `Layout`, header, nav, footer, page-header components; +- React-Bootstrap imports and usage patterns; +- SCSS/CSS modules and variables/tokens; +- `DESIGN_SYSTEM.md`, `COMPONENT_LIBRARY.md`, `LAYOUT_GUIDE.md`, `STYLING.md`, or equivalents; +- existing pages serving similar jobs; +- approved screenshots/mockups; +- frontend state/data/API contracts needed to understand what information exists. + +Prefer adapting an existing strong pattern when one already solves most of the problem. + +## 3. Define the information hierarchy + +Write the page content in priority order before composing layout. + +Classify content/actions roughly as: + +- **Primary** — essential goal/action or key information; +- **Secondary** — commonly useful but not dominant; +- **Supporting** — explanation, metadata, help, context; +- **Exceptional** — destructive, uncommon, advanced, or error-recovery actions. + +Use hierarchy to determine placement and visual emphasis. Avoid giving every action the same button weight. + +## 4. Select the interaction pattern deliberately + +Choose the simplest suitable pattern. + +Examples: + +### List vs table + +Prefer a **table** when users need to compare repeated structured attributes across rows and desktop density matters. + +Prefer a **list/card/list-group composition** when entries have heterogeneous content, primary actions, or need to adapt strongly on narrow screens. + +If a table is necessary on desktop but becomes unusable on mobile, specify the mobile transformation rather than simply allowing horizontal scrolling by default. + +### Inline form vs modal vs dedicated page + +Prefer **inline** for short, contextual edits with low interruption cost. + +Prefer a **modal** for short, self-contained create/edit actions where preserving page context matters. + +Prefer a **dedicated page** for complex, multi-section, high-risk, or deep-linkable forms. + +Do not put long workflows in a modal merely to avoid creating a route. + +### Tabs + +Use tabs when several peer views belong to the same object/context and users frequently switch among them. + +Do not use tabs to hide unrelated page sections or create an artificial information architecture. + +### Offcanvas + +Use for secondary navigation/filter/control surfaces, especially where mobile screen space matters. Do not hide primary actions in an offcanvas without reason. + +### Cards + +Use cards to represent meaningful grouped units. Do not wrap every section in a card by habit. + +See `references/pattern-selection.md` for the decision checklist. + +## 5. Compose the page + +Specify page regions in reading/task order. + +A common structure might be: + +```text +Application shell +└── Page container + ├── Page heading / context + │ ├── title + │ ├── short supporting copy if useful + │ └── primary action + ├── optional controls/filter/search + ├── feedback/status region + └── primary content + ├── empty/loading/error/populated state + └── secondary actions/details +``` + +This is a starting vocabulary, not a mandatory template. + +For each region state: + +- purpose; +- contents; +- action hierarchy; +- alignment/grouping; +- relevant React-Bootstrap primitive or existing project component; +- responsive transformation. + +## 6. Use React-Bootstrap intentionally + +When the project uses React-Bootstrap, prefer the existing library before custom equivalents. + +Common foundations include: + +- `Container` / existing page container — outer page width/gutters; +- `Row`, `Col` — breakpoint-dependent macro grids; +- `Stack` — simple flex composition and spacing; +- `Button`, `ButtonGroup` — action hierarchy; +- `Form`, `Form.Group`, `Form.Control`, `Form.Select`, validation feedback — forms; +- `Alert` — actionable status/error feedback; +- `Spinner`, `Placeholder` — loading indication where appropriate; +- `Table` — genuinely tabular data; +- `ListGroup` — repeated list content; +- `Card` — semantically grouped content; +- `Modal` — short contextual workflows/confirmations; +- `Offcanvas` — secondary responsive surfaces; +- `Dropdown` — secondary action menus; +- `Nav`, `Navbar`, `Tabs` — navigation only when semantically appropriate; +- `Badge` — compact status/category labels; +- `Pagination` — paginated datasets; +- `Accordion` — optional/repeated disclosure content. + +Prefer project wrapper components over raw React-Bootstrap when they already encode the application's style/behavior. + +Do not propose a library component merely because it exists. + +## 7. Define responsive behavior + +Design the transformation, not just three screenshots. + +For relevant regions specify: + +### Broad desktop + +- maximum/content width; +- horizontal grouping; +- density; +- table/grid columns; +- placement of primary action and secondary controls. + +### Intermediate/tablet + +- what wraps; +- what stacks; +- columns that collapse; +- navigation/filter adaptations; +- labels/actions that need more space. + +### Narrow/mobile + +- reading order; +- full-width vs intrinsic controls; +- whether data presentation changes form; +- compact secondary-action patterns; +- touch-target spacing; +- long text/error behavior; +- modal/offcanvas viability. + +Use Bootstrap breakpoints already present in the application when possible. Do not add custom breakpoint complexity without a demonstrated need. + +## 8. Define the state matrix + +For each important page/region, identify applicable states: + +- initial/default; +- loading; +- empty; +- populated; +- partial data; +- validation error; +- server/network error; +- permission/authorization denial; +- success/confirmation; +- disabled/submitting; +- destructive confirmation; +- stale/conflict state if the domain requires it. + +Describe what the user sees and what action remains available. + +Do not design errors as generic red boxes with no recovery action when the application can provide a useful next step. + +See `references/ui-state-checklist.md`. + +## 9. Design forms around completion, not fields + +For forms: + +- group fields by user intent; +- use visible labels; +- distinguish required/optional fields clearly without clutter; +- place help text near the field it explains; +- choose appropriate input types; +- preserve entered data after recoverable validation failures; +- show field-level feedback for field errors and form-level feedback for broader failures; +- make submission state clear; +- prevent accidental duplicate submission where appropriate; +- place destructive actions away from the primary success path; +- use confirmation only when consequence warrants interruption. + +Do not overuse multi-step wizards for short forms. Do not make complex workflows one giant undifferentiated form. + +## 10. Design actions and feedback + +Make the primary action obvious but not visually overwhelming. + +Prefer: + +- one clear primary action per local context; +- secondary buttons/links for secondary actions; +- dropdown/overflow for infrequent peer actions when density requires it; +- explicit destructive styling/confirmation for irreversible actions; +- feedback near the action/result it belongs to; +- persistent page state after successful minor actions where appropriate rather than unnecessary navigation. + +Do not hide important actions behind hover-only behavior. + +## 11. Accessibility-by-design checklist + +Before approval ensure the specification accounts for: + +- semantic controls; +- sensible heading/content order; +- visible labels/accessibility names; +- keyboard operation; +- focus movement for modal/navigation/state changes; +- error association and understandable recovery; +- non-color-only statuses; +- adequate control/touch target sizing; +- readable wrapping/zoom/narrow-width behavior; +- content order that remains logical after responsive stacking. + +Do not claim WCAG compliance from design planning alone. + +## 12. Decide what should become reusable + +Recommend a shared component only when one or more are true: + +- the same semantic pattern already appears repeatedly; +- the new pattern will appear on several pages; +- it carries important behavior/accessibility that should be centralized; +- project consistency would materially benefit. + +Examples can include: + +- `PageHeader`; +- `EmptyState`; +- `StatusBadge`; +- `ConfirmActionModal`; +- domain-specific row/card primitives. + +Do not create generic wrappers around every React-Bootstrap primitive. + +## 13. Present the implementation specification + +For a design-only pass, output a concise implementation-ready specification with these sections: + +### Design mode + +Extend or local defaults, with the approved reference or project pattern used. + +### User goal + +Who is doing what and what is primary. + +### Proposed composition + +A short hierarchy/tree of page regions. + +### Component plan + +Map each region to existing project components / React-Bootstrap primitives. + +### Responsive behavior + +Desktop → intermediate → mobile transformations. + +### State matrix + +Relevant loading/empty/error/populated/success/etc. behavior. + +### Interaction/accessibility notes + +Important action, keyboard, focus, confirmation, form, and semantic expectations. + +### Reuse/new components + +What should be reused and any justified new shared component. + +### Decisions needed + +Only unresolved choices that materially affect UX/implementation. + +### Implementation notes + +A compact specification that supplements the approved handoff and that `webapp-feature` can use for authorised implementation. + +Proceed to implementation only within authorised scope and after the applicable design gate is satisfied. + +## 14. When alternatives are useful + +If the approved direction leaves a material implementation choice open, offer at most two or three options within it. In BortStack, route options that change the approved concept, product flow or visual direction to `bortstack-design`. + +Alternatives must differ in workflow/information architecture, for example: + +- dense comparison table vs responsive item-list workflow; +- split master/detail vs dedicated detail route; +- inline management vs modal-based management. + +Do not present arbitrary cosmetic variations such as three different card styles. + +For each alternative state: + +- best fit; +- tradeoff; +- implementation/maintenance complexity; +- mobile implications. + +Recommend one when evidence supports a clear choice. + +## 15. If implementation is explicitly requested too + +When the user explicitly asks to **design and implement** in one request: + +1. complete the design reasoning first; +2. record/confirm any required decisions; +3. use `webapp-feature` methodology for implementation; +4. preserve task scope; +5. run automated validation; +6. use/recommend `frontend-visual-qa` for actual visual verification. + +Do not silently collapse design and implementation into ad hoc JSX construction. + +## 16. Record decisions and evidence + +Keep the specification within the authorised scope. Send durable UI decisions and changes in approval back through the project’s decision process. Use `bortstack-context` for task and handoff records in BortStack. Record the approved reference/version or explicit override, open implementation decisions and the evidence needed for later QA. + +## 17. Stop conditions + +Stop and ask/present a decision when: + +- two interaction patterns have materially different product consequences; +- required business rules are unresolved; +- the existing design source of truth conflicts internally; +- a requested design would require removing/changing established functionality; +- a responsive transformation changes what information/actions users can access; +- implementation would require a backend/API capability that does not exist and is outside the task; +- the user requested design-only and the implementation-ready specification is complete. + +Do not use uncertainty as an excuse to ask about minor spacing or conventional choices that can be resolved safely from project patterns. + +## 18. Completion report + +For a design-only task, report: + +1. design mode and evidence inspected; +2. user goal and primary action; +3. proposed layout/composition; +4. component/React-Bootstrap plan; +5. responsive behavior; +6. UI state behavior; +7. interaction/accessibility expectations; +8. reusable components proposed; +9. unresolved decisions, if any; +10. recommended next skill: normally `webapp-feature`, followed by `frontend-visual-qa` after implementation. + +Do not report code changes when none were requested. diff --git a/skills/frontend-ui-design/agents/openai.yaml b/skills/frontend-ui-design/agents/openai.yaml new file mode 100644 index 0000000..e6a06d9 --- /dev/null +++ b/skills/frontend-ui-design/agents/openai.yaml @@ -0,0 +1,12 @@ +interface: + display_name: frontend ui design + short_description: Specify layout, components, responsive behavior and UI states within an approved direction. + icon_small: assets/icon.svg + icon_large: assets/icon.svg +policy: + products: + - chatgpt + - codex + - api + - atlas + allow_implicit_invocation: true diff --git a/skills/frontend-ui-design/assets/icon.svg b/skills/frontend-ui-design/assets/icon.svg new file mode 100644 index 0000000..4c3163a --- /dev/null +++ b/skills/frontend-ui-design/assets/icon.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/skills/frontend-ui-design/references/pattern-selection.md b/skills/frontend-ui-design/references/pattern-selection.md new file mode 100644 index 0000000..481cc6a --- /dev/null +++ b/skills/frontend-ui-design/references/pattern-selection.md @@ -0,0 +1,41 @@ +# UI Pattern Selection Checklist + +Use this as a quick decision aid, not a mandatory recipe. + +## Table +Use when users need to compare several repeated fields across many records and density matters. +Avoid when each item has very different content or the mobile transformation becomes unusable. + +## List / ListGroup +Use for scan-friendly repeated items with one main identity and a small set of secondary metadata/actions. + +## Cards +Use when each item/section is a meaningful grouped unit with heterogeneous content. +Avoid wrapping every page section in a card by default. + +## Dedicated form page +Use for complex, deep-linkable, high-risk, or multi-section create/edit workflows. + +## Modal +Use for short self-contained actions where preserving page context helps. +Avoid long forms, multi-step workflows, and tasks users may need to bookmark/deep-link. + +## Offcanvas +Use for secondary navigation/filter/control surfaces where responsive space is constrained. +Do not hide primary workflow actions without reason. + +## Tabs +Use for peer views within the same object/context with frequent switching. +Avoid using tabs as a substitute for proper information hierarchy. + +## Accordion +Use for optional disclosure where users usually need only a subset of sections. +Avoid hiding core task information behind collapsed panels. + +## Wizard / steps +Use when later inputs genuinely depend on earlier decisions, the task is long/high-risk, or progress framing materially helps. +Avoid for short forms that can be completed and reviewed on one page. + +## Master/detail split +Use when users frequently scan a collection and inspect multiple items without losing collection context. +Consider dedicated routes when deep linking, mobile use, or complex detail content matters more. diff --git a/skills/frontend-ui-design/references/ui-state-checklist.md b/skills/frontend-ui-design/references/ui-state-checklist.md new file mode 100644 index 0000000..316119e --- /dev/null +++ b/skills/frontend-ui-design/references/ui-state-checklist.md @@ -0,0 +1,35 @@ +# UI State Checklist + +Only include states relevant to the page/workflow. + +## Data/display +- initial/default +- loading +- empty +- populated +- partial/incomplete data +- stale/conflict if applicable + +## Form/action +- untouched +- editing +- validation failure +- submitting/disabled +- server/network failure +- success/confirmation +- destructive confirmation + +## Access +- unauthenticated +- unauthorized/permission denied +- feature unavailable/blocked where legitimate + +## Responsive +For each important state, ensure content/action order remains sensible after stacking or collapsing. + +## For each state answer +- What does the user see? +- What is the primary available action? +- Can they recover without losing useful work? +- Is status conveyed by more than color alone where needed? +- Does the layout still work with realistic long text/errors/data? diff --git a/skills/frontend-visual-qa/SKILL.md b/skills/frontend-visual-qa/SKILL.md new file mode 100644 index 0000000..0ebc9a7 --- /dev/null +++ b/skills/frontend-visual-qa/SKILL.md @@ -0,0 +1,292 @@ +--- +name: frontend-visual-qa +description: Use when Codex needs to verify or improve the user-visible quality of a web frontend after implementation, especially React applications; when the task involves exercising real routes and workflows, responsive layout, forms, navigation, loading/error/empty states, browser console and network failures, accessibility basics, visual regressions, or comparing implementation against an approved design/source of truth. This skill is for evidence-based QA and narrowly scoped fixes, not unsolicited redesign. +--- + +# Frontend Visual QA + +Version: **2.0**. + +Verify the frontend as a user experiences it. Do not declare a UI task complete merely because tests, lint, or `npm build` pass. Exercise the relevant routes and workflows in a browser-capable environment when available, inspect visual/runtime evidence, fix only confirmed in-scope defects, re-check the affected states, and report what was and was not verified. + +This skill is designed to compose with `bortstack-context` and `webapp-feature`/`webapp-debug`. The context skill owns project/task/decision/handoff semantics. Feature/debug skills own implementation/root-cause workflow. This skill owns **frontend experiential verification**. + +## Repository workflow + +In a BortStack project, use `bortstack-context` with the applicable repository `AGENTS.md` before task work. They govern scope and authorisation, branch/worktree policy, lifecycle, manual acceptance, and handoff. Find the maintained overview, current state, decisions, task and handoff records through repository instructions and layout. Use the paths and task IDs the project already uses. Follow context's canonical discussion, mission and lifecycle guidance when interpreting authority or changing task status. If a required BortStack skill is unavailable, report the dependency. If an installed skill lacks a required reference, use the reference from a verified Forge package with a matching manifest. If the required guidance is unavailable, pause the affected action. + +For edits, inspect Git status and worktrees, confirm authorised scope and the source candidate, and follow the current branch policy. Use direct integration-branch work where authorised and a dedicated branch/worktree where required. Preserve unrelated work. Read-only specialist work does not require a new worktree. When acting as an authorised contributor, use `bortstack-contributor` for contributor permissions, finalisation and submission. For ordinary specialist work, use the project's normal authority. + +When manual testing is relevant, discover the documented commands, configuration and hooks in the target repository. Use its supported workflow, including an existing `testtask` wrapper and its project-specific config or hook where documented. Preserve a working adapter and its supported invocation. Before use, inspect its supported arguments, candidate handling, runtime and cleanup behavior. If no adapter is required, use the established development environment. Record candidate identity, actual checks, limitations and pending human acceptance in the project's handoff. Refresh stale candidates after edits and make fixes in the authoritative source. A source snapshot, wrapper, automated check or startup alone does not establish a manual pass. Follow context and repository rules for task transitions and closure. + +Outside BortStack, follow the repository's own scope, branch, test and reporting conventions and proceed with the specialist workflow. BortStack skills and records are optional there. + +## Core rules + +1. **Read repository instructions and design context first.** Obey `AGENTS.md`, project context, existing design-system/component/layout docs, task acceptance criteria, screenshots/mockups explicitly approved by the user, and repository-specific frontend validation commands. +2. **Preserve the approved design.** Visual QA is not permission to redesign, restyle, modernize, simplify, or add controls/content that were not requested. +3. **Exercise the real UI when practical.** Prefer a browser against the actual local/test app over reasoning solely from JSX/CSS or successful builds. +4. **Verify states, not just pages.** Check relevant default, loading, empty, populated, validation-error, server-error, disabled, success, authenticated/unauthenticated, expanded/collapsed, and responsive states where the workflow supports them. +5. **Check runtime evidence.** Browser console errors, failed network requests, uncaught exceptions, broken assets, hydration/runtime warnings, and API failures are QA findings even when the layout looks correct. +6. **Use representative viewports.** At minimum test the task's supported desktop and narrow/mobile layouts when responsive behavior is relevant; include tablet/intermediate widths when the layout has breakpoint-sensitive composition. +7. **Fix only evidence-backed, in-scope defects.** Do not perform opportunistic design polish or component refactors while checking one feature. +8. **Respect visual source-of-truth order.** Approved project screenshots/design docs/user decisions outrank generic aesthetic preference. Existing working conventions outrank invented alternatives. +9. **Do not hide application defects with CSS.** Trace functional failures to the appropriate frontend/backend layer and hand off to `webapp-debug` when root cause is not a visual implementation issue. +10. **Accessibility checks are practical, not ceremonial.** Verify keyboard reachability, labels/names, focus visibility, semantic controls, obvious contrast/readability, and basic screen-size robustness when relevant. Do not claim formal WCAG compliance unless it was actually audited. +11. **Capture before/after evidence where tooling permits.** Screenshots, DOM/state observations, console/network evidence, and exact reproduction steps are preferable to vague statements such as “looks good”. +12. **Re-run the exact failing state after a fix.** Then run relevant automated frontend checks/builds. +13. **Do not commit, push, deploy, switch branches, or start another task unless explicitly requested.** +14. **Report limitations honestly.** If no browser/runtime is available, say the visual portion was not verified; static inspection/build success is not equivalent. + +## Establish the QA contract + +Before changing anything, determine: + +- the route(s), component(s), and workflow(s) in scope; +- the accepted visual/design source of truth, if any; +- supported viewport/breakpoint expectations; +- required authentication/data state; +- which interaction states matter to the task; +- whether visual fixes are authorized or the task is verification-only; +- what automated checks exist for the frontend; +- what evidence will count as passing. + +If a task says only “check the frontend”, inspect project context and the changed feature to narrow the smallest useful QA surface rather than browsing the whole application indefinitely. + +When design fidelity is in scope, use the project’s approved design reference and version. In BortStack, use the `bortstack-design` handoff when applicable and respect any recorded override. Report fidelity as unverified when no comparison reference is available. Verify the exact implementation independently in the browser, through the real application route and navigation. Send design discrepancies that require a change to the approved direction back through design and context. Keep QA evidence distinct from human acceptance. + +## 1. Inspect before launching + +Read the relevant implementation and project conventions: + +- route definitions and page/component entry points; +- shared layout/header/footer/navigation components; +- CSS/SCSS modules, tokens, variables, design-system docs; +- reusable form/input/button/card/table/modal components; +- relevant context/store/API-client code; +- existing component/frontend tests; +- environment/start/build commands; +- approved screenshots/mockups or design docs if present. + +Identify expected content and responsive behavior from repository evidence. Do not infer requirements from fashionable UI patterns. + +## 2. Start the app using repository conventions + +Identify the exact build or working-tree candidate, including intended untracked changes where applicable. If using a repository test snapshot, verify that it reflects that candidate and refresh it before retesting fixes. + +Use the project's documented local/test workflow. Prefer existing scripts/Compose/dev-server commands rather than inventing a new environment. + +Before visual inspection, establish that: + +- frontend loads without fatal runtime errors; +- required backend/API dependencies are available or intentionally mocked by repository convention; +- the intended route can be reached; +- required fixture/test data or account state can be established safely. + +Do not mutate production data or use real credentials merely to perform visual QA. + +If the runtime cannot be started, continue with available automated/static checks but report **browser visual QA blocked** rather than claiming the UI passed. + +## 3. Exercise the workflow + +Follow the user journey, not just the DOM structure. + +For each in-scope workflow, verify as applicable: + +- page entry/navigation; +- primary action; +- form entry and submission; +- client-side validation; +- backend/API validation rendering; +- loading/progress behavior; +- success confirmation and resulting state; +- empty state; +- populated/list/detail state; +- error/retry state; +- modal/dropdown/accordion/tab interactions; +- destructive-action confirmation; +- authentication/authorization presentation; +- back/refresh/deep-link behavior where relevant. + +Check browser console and network activity during the workflow, not only after it. + +Use `references/state-matrix.md` to avoid forgetting relevant states. + +## 4. Check responsive layout deliberately + +Do not equate “responsive” with “nothing visibly overflows at one phone width”. + +At relevant widths inspect: + +- horizontal overflow and clipped content; +- navigation collapse/wrapping; +- page gutters and container widths; +- grids/cards/tables/forms stacking behavior; +- controls that become too narrow or overlap; +- typography wrapping/truncation; +- images/media aspect ratios; +- fixed/sticky elements covering content; +- modal/dropdown boundaries; +- long labels, validation messages, and realistic content; +- touch-target usability on narrow screens; +- vertical spacing that breaks when content wraps. + +Prefer representative widths around the application's actual breakpoints. If none are documented, use a sensible broad desktop, intermediate/tablet, and narrow mobile sample and state what was tested. + +Do not add new breakpoints unless evidence shows the current responsive contract cannot satisfy the task. + +## 5. Check visual consistency against project conventions + +Inspect only within the approved design language: + +- typography hierarchy; +- spacing rhythm; +- alignment; +- component variants; +- button hierarchy; +- form-label/help/error treatment; +- card/table/list consistency; +- icon usage; +- loading/empty/error presentation; +- header/footer/layout alignment; +- light/dark theme behavior if the project supports themes. + +A difference is not a defect simply because you prefer another style. Record a visual defect when it conflicts with accepted design evidence, causes usability/readability problems, or is internally inconsistent with established components. + +## 6. Check browser/runtime health + +During visual QA inspect, when tooling exposes them: + +### Console + +Look for: + +- uncaught exceptions; +- React runtime warnings relevant to the workflow; +- missing-key or lifecycle/effect warnings introduced by the change; +- failed asset/module loads; +- accessibility/runtime warnings from existing tooling; +- repeated errors caused by render/request loops. + +Do not fail a task solely for unrelated pre-existing warnings. Separate new/relevant findings from known baseline noise. + +### Network + +Check relevant requests for: + +- unexpected 4xx/5xx responses; +- wrong URL/method/query/payload; +- requests firing repeatedly or not at all; +- unauthenticated/authorization failures; +- stale or incorrect response rendering; +- broken asset/font/image requests; +- CORS/CSRF/token problems; +- user actions that appear successful despite request failure. + +If the UI defect originates in backend/auth/data behavior, switch to or recommend `webapp-debug`; do not mask it with frontend presentation changes. + +## 7. Check practical accessibility basics + +For relevant interactions, verify: + +- interactive elements are actual semantic controls where practical; +- keyboard users can reach and activate primary interactions; +- focus remains visible and logically placed; +- form fields have associated accessible names/labels; +- validation/error messages are understandable and associated with the action/field where feasible; +- icon-only controls have an accessible name; +- dialogs/modals do not create obvious keyboard traps or lose focus catastrophically; +- headings/page landmarks are reasonably structured; +- content remains readable at narrow widths/zoom-like conditions; +- obvious color-only state communication has another cue where the project convention permits. + +Automated accessibility tooling can supplement this, but do not claim comprehensive accessibility compliance from a quick scan. + +Use `references/accessibility-basics.md` as a lightweight checklist. + +## 8. Classify findings before editing + +For each finding, classify it as one of: + +- **Functional runtime defect** — action/request/state is wrong; often route to debugging workflow. +- **Visual/layout defect** — presentation violates task/design contract or impairs use. +- **Responsive defect** — presentation fails at supported width/state. +- **Accessibility defect** — basic interaction/name/focus/semantic problem. +- **Design discrepancy** — implementation differs from an explicit approved source of truth. +- **Pre-existing unrelated issue** — record/report without silently expanding scope. +- **Unable to verify** — environment/data/tooling prevented confirmation. + +Prioritize blockers to the task's core workflow over cosmetic inconsistencies. + +## 9. Make the smallest authorized fix + +When fixes are in scope: + +- reuse existing components/tokens/layout conventions; +- change the narrowest CSS/component/state code that explains the defect; +- preserve API/domain behavior unless that behavior is the actual defect; +- avoid global CSS changes for a local problem unless the shared primitive itself is proven wrong; +- avoid arbitrary pixel nudges that only work at the tested viewport; +- test realistic long/empty/error content after layout fixes; +- do not redesign adjacent pages for consistency unless explicitly included in scope. + +If the correct fix requires a product/design decision not already established, stop at the decision boundary and present the concrete alternatives/evidence. + +## 10. Re-verify after fixes + +For every fixed finding: + +1. repeat the exact reproduction at the viewport/state where it failed; +2. check neighboring responsive widths/states for regressions; +3. re-run the affected interaction; +4. check console/network again; +5. run targeted component/frontend tests; +6. run repository lint/type/static checks as appropriate; +7. run the production frontend build when relevant; +8. run any project-specific visual/E2E checks. + +Do not substitute an automated build for re-checking a visual defect in a browser. + +If the project has screenshot/visual-regression tests, update baselines only when the visual change is explicitly intended and approved. Never accept a changed baseline merely to make the test pass. + +## 11. Update project context appropriately + +When used with BortStack: + +- follow `bortstack-context` for task status and handoff semantics; +- record significant verified frontend weaknesses in the project’s current-state record when they materially affect the documented state; +- do not turn every QA observation into authorised implementation work; +- recording follow-up work is appropriate only where project conventions/user instruction permit it; +- do not add a durable design decision merely because a small implementation detail changed. + +## Completion standard + +Frontend visual QA is complete only when, to the extent supported by the available environment: + +- the in-scope workflow has been exercised; +- relevant viewport/state coverage has been checked; +- console/network health was inspected; +- confirmed in-scope findings were fixed or explicitly left unresolved; +- fixed findings were re-verified; +- relevant automated frontend validation passed or limitations were recorded; +- no unrelated redesign/refactor was introduced; +- context was updated when materially required. + +A successful `npm build` alone does **not** satisfy this completion standard. + +## Final report + +Report concisely: + +1. routes/workflows and design evidence inspected; +2. runtime/browser environment used; +3. viewport/state matrix actually tested; +4. findings, classified by type and severity/impact; +5. files changed and exact fixes, if fixes were authorized; +6. console/network observations; +7. accessibility checks performed; +8. automated validation and exact results; +9. anything that could not be verified; +10. final task/QA status and any context updates. + +Do not claim the whole application is visually correct when only a subset was inspected. diff --git a/skills/frontend-visual-qa/agents/openai.yaml b/skills/frontend-visual-qa/agents/openai.yaml new file mode 100644 index 0000000..65f0e5e --- /dev/null +++ b/skills/frontend-visual-qa/agents/openai.yaml @@ -0,0 +1,18 @@ +interface: + display_name: frontend visual qa + short_description: Use when Codex needs to verify or improve the user-visible quality + of a web frontend after implementation, especially React applications; when the + task involves exercising real routes and workflows, responsive layout, forms, + navigation, loading/error/empty states, browser console and network failures, + accessibility basics, visual regressions, or comparing implementation against + an approved design/source of truth. This skill is for evidence-based QA and narrowly + scoped fixes, not unsolicited redesign. + icon_small: assets/icon.svg + icon_large: assets/icon.svg +policy: + products: + - chatgpt + - codex + - api + - atlas + allow_implicit_invocation: true diff --git a/skills/frontend-visual-qa/assets/icon.svg b/skills/frontend-visual-qa/assets/icon.svg new file mode 100644 index 0000000..f0ec0fb --- /dev/null +++ b/skills/frontend-visual-qa/assets/icon.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/skills/frontend-visual-qa/references/accessibility-basics.md b/skills/frontend-visual-qa/references/accessibility-basics.md new file mode 100644 index 0000000..4c5cde1 --- /dev/null +++ b/skills/frontend-visual-qa/references/accessibility-basics.md @@ -0,0 +1,34 @@ +# Practical Accessibility Basics + +This is a lightweight QA checklist, not a formal conformance audit. + +## Keyboard and focus + +- Primary controls are reachable with keyboard navigation. +- Buttons/links can be activated using expected keyboard behavior. +- Focus is visibly discernible. +- Focus order roughly follows the visual/task order. +- Opening/closing modal or popover interactions does not obviously strand focus. + +## Names and semantics + +- Inputs have labels or accessible names. +- Icon-only controls have meaningful accessible names. +- Buttons are buttons and navigation actions are links where practical. +- Headings are used as structure rather than merely visual styling. + +## Errors and status + +- Validation failures are understandable without relying only on color. +- Error/success messages are visible and located near the affected workflow. +- Disabled controls are not the only explanation of why an action cannot proceed when the user needs guidance. + +## Responsive/readability + +- Text does not disappear or become unusably clipped at narrow widths. +- Zoom-like wrapping does not cause critical controls to overlap. +- Touch-oriented controls are not obviously too small/crowded for the supported mobile layout. + +## Claims + +Automated scans, quick keyboard checks, or visual inspection alone do not justify claiming WCAG/ADA conformance. Report exactly what was checked. diff --git a/skills/frontend-visual-qa/references/state-matrix.md b/skills/frontend-visual-qa/references/state-matrix.md new file mode 100644 index 0000000..5df37ec --- /dev/null +++ b/skills/frontend-visual-qa/references/state-matrix.md @@ -0,0 +1,17 @@ +# Frontend State Matrix + +Use only the states relevant to the task. The purpose is to prevent "happy path only" QA, not to force exhaustive application-wide testing. + +| Area | Candidate states | +|---|---| +| Route/page | initial load, deep link, refresh, back/forward, not-found | +| Data | loading, empty, populated, long content, stale/missing record | +| Form | pristine, focused, invalid client input, server validation error, submitting, success, duplicate submit | +| Auth | unauthenticated, authenticated permitted, authenticated forbidden, expired auth if relevant | +| Request | pending, success, expected 4xx, unexpected 5xx/network failure | +| Interactive UI | closed/open, selected/unselected, disabled/enabled, expanded/collapsed | +| Destructive action | confirmation open, cancel, confirm, failure, success | +| Responsive | broad desktop, breakpoint/intermediate, narrow/mobile | +| Theme | supported light/dark/system variants when the task touches themed UI | + +For every state actually tested, note the viewport and the concrete expected/observed result. diff --git a/skills/production-readiness-review/SKILL.md b/skills/production-readiness-review/SKILL.md new file mode 100644 index 0000000..10d6c2e --- /dev/null +++ b/skills/production-readiness-review/SKILL.md @@ -0,0 +1,208 @@ +--- +name: production-readiness-review +description: Audit a web application for concrete production-readiness risks across security, auth, secrets, data/migrations, logging, backups, deployment, recovery, dependencies, privacy/legal obligations, testing, and operations. Use repository evidence, distinguish verified gaps from assumptions, rank findings by severity/release impact, and do not turn findings into accepted work without user approval. +--- + +# Production Readiness Review + +Version: **2.0**. + +Use this skill when the user asks whether a web application is ready for production, wants a launch audit, pre-deployment review, go-live checklist, operational risk assessment, or professionalisation review. + +## Repository workflow + +In a BortStack project, use `bortstack-context` with the applicable repository `AGENTS.md` before task work. They govern scope and authorisation, branch/worktree policy, lifecycle, manual acceptance, and handoff. Find the maintained overview, current state, decisions, task and handoff records through repository instructions and layout. Use the paths and task IDs the project already uses. Follow context's canonical discussion, mission and lifecycle guidance when interpreting authority or changing task status. If a required BortStack skill is unavailable, report the dependency. If an installed skill lacks a required reference, use the reference from a verified Forge package with a matching manifest. If the required guidance is unavailable, pause the affected action. + +For edits, inspect Git status and worktrees, confirm authorised scope and the source candidate, and follow the current branch policy. Use direct integration-branch work where authorised and a dedicated branch/worktree where required. Preserve unrelated work. Read-only specialist work does not require a new worktree. When acting as an authorised contributor, use `bortstack-contributor` for contributor permissions, finalisation and submission. For ordinary specialist work, use the project's normal authority. + +When manual testing is relevant, discover the documented commands, configuration and hooks in the target repository. Use its supported workflow, including an existing `testtask` wrapper and its project-specific config or hook where documented. Preserve a working adapter and its supported invocation. Before use, inspect its supported arguments, candidate handling, runtime and cleanup behavior. If no adapter is required, use the established development environment. Record candidate identity, actual checks, limitations and pending human acceptance in the project's handoff. Refresh stale candidates after edits and make fixes in the authoritative source. A source snapshot, wrapper, automated check or startup alone does not establish a manual pass. Follow context and repository rules for task transitions and closure. + +Outside BortStack, follow the repository's own scope, branch, test and reporting conventions and proceed with the specialist workflow. BortStack skills and records are optional there. + +## Review findings and release evidence + +Report findings first. Distinguish fresh observations of the exact candidate from historical documentation and unverified infrastructure. Read the project's release authority rules. Record verified durable facts or create follow-up tasks only when authorised, using the project's lifecycle and records. + +## Core principle + +A production-readiness review is evidence-based and release-oriented. + +Do not ask "could this be improved?" Ask: + +- Can this fail, leak, corrupt, lock out, expose, or become unrecoverable in production? +- Is the risk real in the current code/configuration/deployment path? +- Is there evidence that the control exists and works? +- Would this block launch, require mitigation before launch, or be acceptable follow-up? + +Do not manufacture findings to fill categories. + +## Review workflow + +### 1. Establish scope and deployment model + +Read repository context and inspect the actual repository. Determine, where evidence permits: + +- frontend/backend/database architecture; +- authentication and authorization model; +- deployment topology; +- reverse proxy/TLS setup; +- secrets/configuration mechanism; +- migrations/data lifecycle; +- email or third-party integrations; +- CI/CD and release process; +- backup/restore approach; +- logging/monitoring/alerting; +- user-data/privacy/legal surface; +- supported runtimes/dependencies. + +If production infrastructure is external and not available, distinguish repository evidence from unverified production state. + +### 2. Inspect concrete evidence + +Prioritize evidence such as: + +- app configuration and example env files; +- auth decorators/middleware/routes; +- models and migrations; +- error handlers; +- Docker/Compose/Nginx/SWAG/proxy config; +- CI workflows; +- dependency manifests and lockfiles; +- tests; +- operational docs/runbooks; +- backup scripts/config; +- health checks; +- log configuration; +- legal/privacy pages and data-handling code where relevant. + +Do not rely on README claims when code/config says otherwise. + +### 3. Evaluate the review domains + +Use `references/readiness-checklist.md` as a coverage guide. Skip irrelevant domains. Use `references/finding-quality.md` to check evidence and severity. + +Important domains include: + +- authentication and authorization; +- session/token lifecycle; +- input validation and output handling; +- secrets and environment configuration; +- database constraints/migrations/data integrity; +- backup and restore; +- error handling and information exposure; +- logging, monitoring, alerting, and health; +- rate limits/abuse controls when the app exposes abuse-prone endpoints; +- dependency/runtime support and pinning; +- container/reverse-proxy/TLS hardening; +- CI/CD and rollback/recovery; +- email/webhook/third-party failure handling; +- privacy, retention, consent, legal pages, and data deletion where the product requires them; +- test coverage for critical flows; +- operational ownership/runbooks. + +### 4. Prove findings + +Every finding must include a concrete evidence path. + +Good finding: + +> Password-reset tokens remain valid after use because the reset route verifies the token but never revokes or rotates the associated reset state; the same token can therefore be replayed until expiry. + +Weak finding: + +> Consider improving password reset security. + +Do not report the weak form. + +### 5. Rank findings + +Use these severities: + +- **Critical** — immediate compromise, destructive data-loss path, or release-blocking defect with severe impact and realistic exploit/failure path. +- **High** — serious security/reliability/data-integrity/operational risk that should normally block production launch until fixed or explicitly mitigated. +- **Medium** — meaningful production risk that should be addressed soon but may be acceptable for launch with conscious mitigation/monitoring. +- **Low** — real but limited operational or maintainability risk; useful follow-up, not launch-blocking by itself. + +Also assign a release disposition when useful: + +- **Block launch** +- **Fix before launch** +- **Mitigate/monitor for launch** +- **Post-launch follow-up** + +Do not automatically translate these into repository P0/P1 task priorities. + +### 6. Validate where practical + +Run non-destructive checks that materially improve confidence, such as: + +- backend/frontend test suites; +- lint/build; +- migration validation on a disposable database; +- config syntax checks; +- Docker Compose validation; +- dependency metadata checks available locally; +- health/smoke checks against a local environment; +- backup/restore test only when safe and supported. + +Do not mutate production, rotate secrets, run destructive migrations, purge data, or alter infrastructure without explicit authorization. + +If validation is blocked, say exactly why and reduce confidence accordingly. + +### 7. Produce a release-oriented verdict + +Use one of: + +- **Ready** — no material launch blockers found in reviewed scope. +- **Ready with conditions** — launch may proceed only with explicit mitigations/known follow-up. +- **Not ready** — one or more launch-blocking risks remain. +- **Review incomplete** — evidence/runtime access is insufficient for a defensible readiness verdict. + +Do not say "Ready" if critical production surfaces were unavailable and unverified. + +## Output format + +Start with the verdict and one concise explanation. + +Then list only substantiated findings, highest severity first. For each include: + +- Severity +- Release disposition +- Location/domain +- Risk +- Evidence / execution path +- Recommended remediation +- Validation that should prove remediation + +Then include: + +- Scope/evidence inspected +- Validation run and exact results +- Areas reviewed with no material findings +- Unverified production assumptions / remaining uncertainties +- Suggested next actions +- Context/task updates made, if any + +If there are no findings in a domain, do not invent one. + +## Safety and scope rules + +- Review is read-only by default. +- Do not commit, push, deploy, rotate credentials, change DNS/TLS, or modify production infrastructure unless explicitly asked. +- Do not expose secret values in the report. If secrets are committed, identify locations/types without reproducing the secret. +- Do not weaken security to make tests pass. +- Do not call historical test output fresh validation. +- Do not assume a backup is usable merely because backup files/scripts exist; restore evidence matters. +- Do not claim compliance certification (GDPR, PCI DSS, SOC 2, etc.) from a repository review. +- Do not treat generic best-practice absence as a finding unless it creates a concrete risk for this application/deployment model. + +## Completion criteria + +A review is complete only when: + +1. repository/deployment evidence has been inspected sufficiently for the requested scope; +2. findings are concrete and evidence-backed; +3. severity/release impact is justified; +4. available non-destructive validation has been run or its absence explained; +5. production-only unknowns are clearly separated from repository facts; +6. the verdict matches the actual evidence. diff --git a/skills/production-readiness-review/agents/openai.yaml b/skills/production-readiness-review/agents/openai.yaml new file mode 100644 index 0000000..2c5814d --- /dev/null +++ b/skills/production-readiness-review/agents/openai.yaml @@ -0,0 +1,17 @@ +interface: + display_name: production readiness review + short_description: Audit a web application for concrete production-readiness risks + across security, auth, secrets, data/migrations, logging, backups, deployment, + recovery, dependencies, privacy/legal obligations, testing, and operations. Use + repository evidence, distinguish verified gaps from assumptions, rank findings + by severity/release impact, and do not turn findings into accepted work without + user approval. + icon_small: assets/icon.svg + icon_large: assets/icon.svg +policy: + products: + - chatgpt + - codex + - api + - atlas + allow_implicit_invocation: true diff --git a/skills/production-readiness-review/assets/icon.svg b/skills/production-readiness-review/assets/icon.svg new file mode 100644 index 0000000..2468028 --- /dev/null +++ b/skills/production-readiness-review/assets/icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/skills/production-readiness-review/references/finding-quality.md b/skills/production-readiness-review/references/finding-quality.md new file mode 100644 index 0000000..f33fe13 --- /dev/null +++ b/skills/production-readiness-review/references/finding-quality.md @@ -0,0 +1,18 @@ +# Finding Quality Guide + +A useful readiness finding is: + +1. Current — exists in the reviewed repository/deployment evidence. +2. Concrete — names the actual failure/security/operational path. +3. Impactful — explains production consequence. +4. Evidence-backed — cites code/config/test/runtime evidence. +5. Actionable — remediation is specific enough to implement. +6. Verifiable — includes how the remediation should be tested. + +Avoid: +- generic best-practice checklists pasted as findings; +- speculative attack paths with no reachable input; +- "add monitoring" without explaining which failure is currently invisible; +- "use stronger security" without identifying a broken control; +- style/architecture preferences unrelated to release risk; +- presenting unverified production assumptions as facts. diff --git a/skills/production-readiness-review/references/readiness-checklist.md b/skills/production-readiness-review/references/readiness-checklist.md new file mode 100644 index 0000000..c642ffc --- /dev/null +++ b/skills/production-readiness-review/references/readiness-checklist.md @@ -0,0 +1,95 @@ +# Production Readiness Coverage Checklist + +Use as a coverage guide, not a mandatory finding generator. + +## Identity, authentication, authorization +- registration/login/reset/verification flows +- token/session expiration, rotation, revocation +- protected routes/endpoints +- role/ownership authorization +- brute force / abuse exposure where applicable +- account enumeration / sensitive error leakage + +## Input, output, and application security +- server-side validation +- unsafe deserialization/file handling +- injection paths +- XSS/HTML rendering paths +- CSRF where cookie-authenticated state changes exist +- security headers/proxy behavior where relevant +- debug/development modes + +## Secrets and configuration +- `.env` exclusion +- example env completeness without real secrets +- secret injection in deployment +- default credentials +- environment-specific settings +- fail-closed behavior for missing critical config + +## Database and data integrity +- migrations present and ordered +- destructive/schema-change risk +- constraints/uniqueness/foreign keys +- transactions and concurrency +- seed/admin provisioning safety +- rollback/restore implications + +## Reliability and operations +- health checks +- error handling +- graceful dependency failure +- logs useful for diagnosis without leaking secrets/PII +- monitoring/alerting expectations +- resource limits/timeouts where deployment makes them relevant + +## Backup and recovery +- what is backed up +- schedule/retention +- encryption/access control +- restore procedure +- evidence of restore testing +- RPO/RTO expectations if documented + +## Runtime/dependencies +- supported Python/Node/DB versions +- lockfiles/pinning +- unsupported/EOL runtimes +- known local dependency conflicts +- reproducible builds + +## Deployment and delivery +- CI test/build gates +- image/build provenance +- migrations during deploy +- rollback strategy +- reverse proxy/TLS +- HTTP→HTTPS and hostname behavior +- production debug exposure + +## Third-party services +- email provider +- payment provider if any +- object storage +- webhooks +- timeouts/retries/idempotency +- secret scopes and failure handling + +## Privacy/legal/product obligations +Only where relevant to the product/jurisdiction: +- privacy notice +- cookies/tracking consent +- terms/legal pages +- data retention/deletion +- user export/delete flows if required by product policy +- collection minimization + +Do not claim legal compliance; identify implementation/documentation gaps only. + +## Testing +- critical auth/account lifecycle +- authorization failures +- destructive/data-integrity flows +- migration tests +- frontend critical workflows +- production config/smoke tests diff --git a/skills/project-commercial-management/SKILL.md b/skills/project-commercial-management/SKILL.md new file mode 100644 index 0000000..84569e3 --- /dev/null +++ b/skills/project-commercial-management/SKILL.md @@ -0,0 +1,392 @@ +--- +name: project-commercial-management +description: Connect development projects and tasks to quotes, invoices, payments, costs, and profitability while keeping the accounting system authoritative for money. +--- + +# Project Commercial Management + +Version: **2.0**. + +## Repository workflow + +In a BortStack project, use `bortstack-context` with the applicable repository `AGENTS.md` before task work. They govern scope and authorisation, branch/worktree policy, lifecycle, manual acceptance, and handoff. Find the maintained overview, current state, decisions, task and handoff records through repository instructions and layout. Use the paths and task IDs the project already uses. Follow context's canonical discussion, mission and lifecycle guidance when interpreting authority or changing task status. If a required BortStack skill is unavailable, report the dependency. If an installed skill lacks a required reference, use the reference from a verified Forge package with a matching manifest. If the required guidance is unavailable, pause the affected action. + +For edits, inspect Git status and worktrees, confirm authorised scope and the source candidate, and follow the current branch policy. Use direct integration-branch work where authorised and a dedicated branch/worktree where required. Preserve unrelated work. Read-only specialist work does not require a new worktree. When acting as an authorised contributor, use `bortstack-contributor` for contributor permissions, finalisation and submission. For ordinary specialist work, use the project's normal authority. + +When manual testing is relevant, discover the documented commands, configuration and hooks in the target repository. Use its supported workflow, including an existing `testtask` wrapper and its project-specific config or hook where documented. Preserve a working adapter and its supported invocation. Before use, inspect its supported arguments, candidate handling, runtime and cleanup behavior. If no adapter is required, use the established development environment. Record candidate identity, actual checks, limitations and pending human acceptance in the project's handoff. Refresh stale candidates after edits and make fixes in the authoritative source. A source snapshot, wrapper, automated check or startup alone does not establish a manual pass. Follow context and repository rules for task transitions and closure. + +Outside BortStack, follow the repository's own scope, branch, test and reporting conventions and proceed with the specialist workflow. BortStack skills and records are optional there. + +## Purpose + +Use this skill when development work needs to be related to commercial/accounting activity. + +Typical questions: +- Is this task covered by an accepted quote? +- Is this new feature additional scope? +- Which quote line does this task belong to? +- Which completed work is ready for billing review? +- What has been invoiced, paid, outstanding, or left unbilled? +- Which costs belong to this project? +- What is the commercial position or profitability of the project? + +This skill bridges: + +```text +development repository/context + ↕ +commercial mapping + ↕ +accounting CLI/API + ↕ +accounting database +``` + +It does not replace the repository context system and does not replace the accounting application. + +## Source-of-truth boundaries + +### Development truth + +The project repository owns requirements, tasks, implementation status, technical decisions, acceptance criteria, and current application state. + +Read the applicable repository instructions and maintained development records. Find any commercial mapping through the project’s documentation and existing files. + +### Accounting truth + +The accounting application/database owns: +- quote IDs, amounts, acceptance/status; +- invoice IDs, dates, lines, totals, and financial status; +- payments and allocations; +- expenses/costs; +- client/accounting-project records; +- balances and profitability calculations. + +Do not treat repository Markdown as authoritative for current money values when the accounting system is available. + +### Commercial mapping + +Use `references/commercial-workflow.md` for the scope-to-billing workflow and `references/accounting-interface.md` to discover the accounting interface. + +The development repository may contain lightweight references mapping engineering work to accounting records. + +Use the project’s existing commercial mapping path. If an authorised mapping task needs a new file, follow repository conventions. + +This is a navigation/mapping document only. It must not become a shadow ledger. + +## Operating modes + +### Commercial status + +Summarize quoted, invoiced, paid, outstanding, unbilled, and cost information by reading repository mappings and querying the accounting system when available. + +Read-only unless a write is explicitly requested. + +### Scope check + +Compare a requested feature/task to accepted quote scope and supplementary quotes. + +Classify: +- **Covered by accepted scope** +- **Partially covered / needs clarification** +- **Potential additional scope** +- **Explicitly excluded** +- **Commercial status unknown** + +Do not infer coverage merely because work is technically related. + +### Quote planning + +Translate agreed requirements into clear commercial line items while preserving useful task/milestone boundaries. + +Separate: +- included scope; +- exclusions/non-goals; +- assumptions; +- dependencies; +- optional work; +- milestones. + +Do not invent prices, tax treatment, discounts, payment terms, or client commitments. + +### Billing review + +For completed work, determine: +- what maps to quoted scope; +- what is already invoiced; +- what appears ready for billing review; +- what remains incomplete/blocked; +- what may be unquoted extra scope. + +Do not issue/send an invoice without explicit authorization. + +### Cost attribution + +Relate accounting expenses to a project using existing accounting references/categories. + +Distinguish: +- direct project cost; +- shared/overhead cost; +- unallocated cost; +- uncertain attribution. + +Do not silently allocate shared costs when policy is unclear. + +### Profitability / commercial performance + +Use accounting records to summarize: +- accepted/contracted value where available; +- invoiced amount; +- payments received; +- outstanding invoices; +- uninvoiced approved work; +- directly attributable project costs; +- optional time/labour measures only if actually tracked. + +Never present repository estimates as actual revenue or payment. + +## Accounting-system integration + +The user's accounting software is a local Python CLI first, with SQLite as the primary datastore, and is intended to become a Flask API + React frontend later. It also supports/targets ODS/CSV exports and branded ODS/PDF reports. + +Prefer integration in this order: + +1. documented accounting CLI; +2. documented accounting API; +3. structured export produced by the accounting application; +4. only if explicitly authorized and no supported interface exists, inspect the accounting project/schema to determine a safe read path. + +Do not manipulate SQLite directly by default. + +Do not invent CLI command names. Inspect the accounting repository/documentation and use commands that actually exist. + +If the accounting system is unavailable, distinguish repository-derived references, user-supplied facts, and accounting facts that cannot be verified. + +## Commercial mapping file + +When useful, maintain the project’s commercial mapping file using `references/commercial-file-template.md`. + +Keep it concise. + +Good content: +- accounting project/client reference; +- accepted quote IDs; +- task/feature/milestone → quote mappings; +- known commercial constraints; +- supplementary quote references; +- high-level billing references; +- unresolved commercial questions. + +Bad content: +- duplicated invoice ledger; +- copied payment history; +- stale financial totals; +- bank/payment secrets; +- tax records that belong in accounting; +- speculative client commitments. + +If the accounting system and the commercial mapping disagree, report the conflict and treat accounting as authoritative for financial state. + +## Task ↔ quote mapping + +A task may map to one quote line, several quote lines, one milestone, approved additional work, internal/non-billable work, or no commercial scope. + +Do not force every engineering task to become a quote line. + +A quote line may span multiple engineering tasks. + +Use actual IDs where available; never manufacture official accounting IDs. + +## Scope-creep guard + +If commercial coverage is uncertain, check it before opening implementation work where practical. Return scope evidence to the repository’s planning workflow (`bortstack-context` in BortStack). A commercial classification does not authorise implementation or financial writes. + +When a new client request is not clearly covered: + +1. identify the requested change; +2. inspect accepted commercial scope; +3. compare inclusions, exclusions, assumptions, and milestones; +4. classify commercial status; +5. recommend commercial review before implementation where needed. + +For potential additional scope, say so plainly. + +Do not block emergency/security work solely because it lacks a quote; surface the commercial issue separately from technical urgency. + +## Billing-review workflow + +1. read completed/accepted development tasks and milestones; +2. query the accounting system for accepted quotes and invoices; +3. map completed work to quote lines/milestones; +4. identify already invoiced work; +5. identify eligible uninvoiced work; +6. identify incomplete/blocked work; +7. identify potential additional scope; +8. report the result. + +Useful classifications: +- **Already invoiced** +- **Ready for billing review** +- **Not yet billable** +- **Potential additional scope** +- **Cannot verify accounting state** + +Do not mark an invoice paid unless accounting records show payment. + +## Cost workflow + +Query accounting records using the project/client/accounting reference. + +Summarize only supported records/categories. Likely categories may include hosting, domains, third-party services, AI/API usage, travel/mileage, subcontractors, and other project-specific expenses. + +The accounting project must preserve its distinction between pre-trading expenses and post-commencement transactions where relevant. + +## Financial safety rules + +Do not: +- fabricate amounts, dates, payments, quote acceptance, invoice status, or tax treatment; +- mark invoices paid from conversation claims when accounting records disagree; +- create/send quotes or invoices without explicit authorization; +- delete/void financial records without explicit authorization; +- silently alter historical financial records; +- store bank/payment secrets in repository docs; +- duplicate the accounting ledger into Git; +- treat projected revenue as received income; +- treat invoice issue as payment; +- assume costs are deductible/tax-allowable without authoritative support. + +Separate project-management facts from tax/accounting judgement when needed. + +## Writes and authorization + +Read/review operations are allowed when requested. + +Treat these as accounting mutations requiring clear user instruction: +- create/update/send quote; +- accept/reject quote on behalf of a party; +- create/update/send invoice; +- record/allocate payment; +- create/change/delete expense; +- issue credit note; +- void/cancel financial document; +- change accounting project/client assignments. + +Use documented accounting CLI/API for writes and report exactly what changed. + +The project’s commercial mapping file may be updated during an explicitly requested commercial reconciliation/mapping task, but do not rewrite financial state from assumptions. + +## Relationship to BortStack Context + +BortStack Context should be commercially aware but not answer authoritative accounting-state questions itself. + +Project Context may: +- notice commercial mappings; +- flag possible additional scope; +- note completed work may need billing review; +- recommend this skill; +- read the project’s commercial mapping file. + +Project Context should route here for: +- quote coverage; +- invoice/payment status; +- project costs; +- billing readiness; +- profitability; +- scope changes with financial implications. + +This skill respects the repository task/decision lifecycle but does not redefine it. + +## Relationship to the development toolkit + +### New client feature + +```text +Project Commercial Management — scope check + ↓ +BortStack Design for concept/approval/handoff (if needed in BortStack) + ↓ +Frontend UI Design for implementation details (if needed) + ↓ +Webapp Feature + ↓ +Frontend Visual QA + ↓ +Code Review + ↓ +Project Commercial Management — billing review +``` + +### Client asks for extra work + +```text +Project Context identifies requirement + ↓ +Project Commercial Management — scope check + ↓ +if additional scope: + supplementary quote/approval + ↓ +accepted development task + ↓ +implementation +``` + +### Completed milestone + +```text +BortStack Context + ↓ +confirm accepted work complete + ↓ +Project Commercial Management — billing review + ↓ +invoice action only if explicitly authorized +``` + +## Output conventions + +For commercial status: +```text +Commercial status +Scope: +Quote: +Billing: +Payments: +Costs: +Potential additional scope: +Uncertainties: +Recommended next action: +``` + +For scope check: +```text +Scope classification: +Evidence: +Mapped quote/milestone: +Why: +Commercial action: +Development action: +``` + +For billing review: +```text +Ready for billing review: +Already invoiced: +Not yet billable: +Potential additional scope: +Accounting state not verified: +Recommended next action: +``` + +## Stop conditions + +Stop rather than guess when: +- accounting data is unavailable and required; +- quote/invoice IDs are ambiguous; +- accepted scope cannot be distinguished from draft scope; +- repository task and accounting mapping conflict; +- client acceptance/payment cannot be verified; +- tax/legal treatment would be required for an accurate answer; +- a requested financial write is ambiguous or destructive. + +Keep technical delivery and commercial truth aligned without making either system dependent on chat history. diff --git a/skills/project-commercial-management/agents/openai.yaml b/skills/project-commercial-management/agents/openai.yaml new file mode 100644 index 0000000..255408b --- /dev/null +++ b/skills/project-commercial-management/agents/openai.yaml @@ -0,0 +1,14 @@ +interface: + display_name: project commercial management + short_description: Connect development projects and tasks to quotes, invoices, payments, + costs, and profitability while keeping the accounting system authoritative for + money. + icon_small: assets/icon.svg + icon_large: assets/icon.svg +policy: + products: + - chatgpt + - codex + - api + - atlas + allow_implicit_invocation: true diff --git a/skills/project-commercial-management/assets/icon.svg b/skills/project-commercial-management/assets/icon.svg new file mode 100644 index 0000000..2468028 --- /dev/null +++ b/skills/project-commercial-management/assets/icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/skills/project-commercial-management/references/accounting-interface.md b/skills/project-commercial-management/references/accounting-interface.md new file mode 100644 index 0000000..235e7a1 --- /dev/null +++ b/skills/project-commercial-management/references/accounting-interface.md @@ -0,0 +1,19 @@ +# Accounting interface guidance + +The accounting application is designed as: +- local Python CLI first; +- SQLite primary datastore; +- future Flask API + React frontend; +- ODS/CSV exports; +- branded ODS/PDF reports; +- pre-trading/post-commencement distinction. + +Integration preference: +1. actual documented CLI; +2. documented API later; +3. structured application exports; +4. avoid direct SQLite mutation by default. + +Do not invent CLI commands. + +If a needed commercial capability does not exist yet, report the missing integration so it can become an accounting-project task through the normal context workflow. diff --git a/skills/project-commercial-management/references/commercial-file-template.md b/skills/project-commercial-management/references/commercial-file-template.md new file mode 100644 index 0000000..66e994c --- /dev/null +++ b/skills/project-commercial-management/references/commercial-file-template.md @@ -0,0 +1,49 @@ +# COMMERCIAL.md template + +```markdown +# Commercial Context + +## References + +Client: +Accounting project ID: + +## Accepted commercial scope + +Accepted quote(s): +- — + +Supplementary quote(s): +- none recorded + +## Development ↔ commercial mapping + +| Development scope | Commercial reference | Notes | +| --- | --- | --- | +| | | | + +## Commercial constraints + +- +- + +## Billing references + +Keep this section referential rather than duplicating the ledger. + +- — + +## Potential additional scope + +- none currently identified + +## Open commercial questions + +- + +## Authority + +The accounting application/database is authoritative for quote amounts, +invoice/payment state, expenses, and financial totals. +This file only maps development work to those records. +``` diff --git a/skills/project-commercial-management/references/commercial-workflow.md b/skills/project-commercial-management/references/commercial-workflow.md new file mode 100644 index 0000000..0ba2034 --- /dev/null +++ b/skills/project-commercial-management/references/commercial-workflow.md @@ -0,0 +1,22 @@ +# Commercial workflow + +## Before implementation +Check whether requested work is accepted development scope and whether it maps to accepted commercial scope. + +Result: +- Covered → normal development workflow. +- Potential extra scope → commercial decision before implementation where practical. +- Unknown → do not pretend coverage is established. + +## During implementation +Do not rewrite financial mappings for every technical subtask. + +Update durable mapping only when the task-to-quote relationship changes materially, a supplementary quote is accepted, scope changes formally, a milestone becomes billable, or accounting IDs are assigned. + +## At completion +Check task acceptance, quote/milestone coverage, existing invoices, incomplete dependencies, and whether completion triggers billing review. + +Task complete does not automatically mean an invoice must be issued. + +## After invoicing/payment +Accounting owns invoice/payment state. The repository may retain only useful references. diff --git a/skills/safe-refactor/SKILL.md b/skills/safe-refactor/SKILL.md new file mode 100644 index 0000000..a4d5f4a --- /dev/null +++ b/skills/safe-refactor/SKILL.md @@ -0,0 +1,271 @@ +--- +name: safe-refactor +description: Use when Codex needs to restructure, simplify, extract, rename, consolidate, modularize, or clean up existing web-application code while preserving observable behavior; especially for React components/hooks/state, Flask routes/services/models, duplicated logic, large modules, testability improvements, dependency boundaries, or architecture cleanup where the goal is safer maintainability rather than new functionality. Establish a behavior baseline, make small reversible changes, validate continuously, avoid opportunistic scope, and report any behavior that changes. +--- + +# Safe Refactor + +Version: **2.0**. + +Refactor structure without casually changing product behavior. Establish what the existing code actually does, protect that behavior with tests or equivalent evidence, make small coherent changes, validate after each meaningful step, and stop when the requested structural objective is achieved. + +This skill is designed to compose with `bortstack-context`. The context skill owns project/task/decision/handoff semantics; this skill owns the refactoring method. Use `webapp-feature` instead when the primary goal is new behavior, and `webapp-debug` when the primary goal is correcting a defect whose root cause is not yet established. + +## Repository workflow + +In a BortStack project, use `bortstack-context` with the applicable repository `AGENTS.md` before task work. They govern scope and authorisation, branch/worktree policy, lifecycle, manual acceptance, and handoff. Find the maintained overview, current state, decisions, task and handoff records through repository instructions and layout. Use the paths and task IDs the project already uses. Follow context's canonical discussion, mission and lifecycle guidance when interpreting authority or changing task status. If a required BortStack skill is unavailable, report the dependency. If an installed skill lacks a required reference, use the reference from a verified Forge package with a matching manifest. If the required guidance is unavailable, pause the affected action. + +For edits, inspect Git status and worktrees, confirm authorised scope and the source candidate, and follow the current branch policy. Use direct integration-branch work where authorised and a dedicated branch/worktree where required. Preserve unrelated work. Read-only specialist work does not require a new worktree. When acting as an authorised contributor, use `bortstack-contributor` for contributor permissions, finalisation and submission. For ordinary specialist work, use the project's normal authority. + +When manual testing is relevant, discover the documented commands, configuration and hooks in the target repository. Use its supported workflow, including an existing `testtask` wrapper and its project-specific config or hook where documented. Preserve a working adapter and its supported invocation. Before use, inspect its supported arguments, candidate handling, runtime and cleanup behavior. If no adapter is required, use the established development environment. Record candidate identity, actual checks, limitations and pending human acceptance in the project's handoff. Refresh stale candidates after edits and make fixes in the authoritative source. A source snapshot, wrapper, automated check or startup alone does not establish a manual pass. Follow context and repository rules for task transitions and closure. + +Outside BortStack, follow the repository's own scope, branch, test and reporting conventions and proceed with the specialist workflow. BortStack skills and records are optional there. + +## Core rules + +1. **Read repository instructions and context first.** Obey root/nested `AGENTS.md`, accepted task scope, durable decisions, architecture conventions, and repository-specific validation requirements. +2. **Define the behavior-preservation boundary before editing.** Identify what users, APIs, callers, tests, persisted data, deployment tooling, and integrations are expected to observe unchanged. +3. **Inspect before reorganizing.** Understand call sites, state/data flow, public interfaces, tests, migrations, configuration, and runtime wiring before moving or deleting code. +4. **Establish a baseline.** Run relevant existing tests/checks where practical and record their result before the refactor. If baseline validation is already failing, distinguish pre-existing failures from refactor regressions. +5. **Prefer characterization tests when behavior is under-specified.** When existing code has important behavior but inadequate coverage, capture that behavior before restructuring it rather than inferring what it "should" do. +6. **Make small, reversible steps.** Prefer extract/move/rename/consolidate steps that can be validated independently over one large rewrite. +7. **Preserve contracts.** Do not silently change API shapes/status codes, URL routes, component props, public exports, database schema/data semantics, auth rules, configuration names, CLI commands, persistence formats, or externally consumed behavior. +8. **Do not smuggle feature work into a refactor.** New business rules, UX changes, bug fixes, schema redesign, dependency upgrades, performance changes, or style redesign need explicit scope or a separate task/workflow. +9. **Do not "clean up" unknown behavior.** Odd-looking logic may encode a real requirement. Prove it is redundant or incorrect before removing it. +10. **Preserve data and migration safety.** Refactoring model/domain code does not authorize destructive migrations, column renames, data rewrites, or migration-history edits. +11. **Validate continuously.** Run targeted checks after each meaningful step and the appropriate broader suite at the end. Never claim validation that was not run. +12. **Keep diffs reviewable.** Avoid unrelated formatting churn, mass renames, dependency-lockfile noise, generated-file rewrites, or broad automated transformations unless specifically required. +13. **Use repository architecture, not preferred architecture.** Improve within existing conventions unless the accepted task explicitly authorizes an architectural change. +14. **Update durable context only when warranted.** Use the repository workflow for task, current state, decisions and handoff updates. A purely internal refactor often needs no new durable decision if externally meaningful architecture and behavior remain unchanged. +15. **Do not commit, push, switch branches, deploy, provision, or start another task unless explicitly requested.** +16. **Stop at the refactor objective.** Do not continue polishing neighboring code because it is convenient. + +## Establish the refactor contract + +Before editing, identify: + +- the accepted task/request and explicit objective; +- the files/modules/components involved; +- the reason for the refactor (duplication, size, coupling, testability, ownership, naming, boundary clarity, etc.); +- observable behaviors that must remain unchanged; +- public/internal interfaces that callers depend on; +- database/config/deployment surfaces that must remain stable; +- known existing failures or technical constraints; +- non-goals; +- validation required to demonstrate behavioral equivalence. + +If the requested refactor implicitly requires a behavior or architecture decision that is not established, stop at that boundary rather than inventing it. + +## 1. Inspect the current implementation + +Trace the affected code sufficiently to answer: + +- Who calls it? +- What does it call? +- What state/data does it read or mutate? +- Which errors/statuses/side effects are observable? +- Which tests exercise it? +- Which configuration, migrations, routes, exports, imports, styles, or runtime wiring depend on it? +- Are there dynamically referenced names, reflection, serializers, dependency injection, route registration, Flask blueprints, React lazy imports, CSS selectors, or test fixtures that make a rename/move non-local? + +Search the repository for every public symbol/path/config key affected before renaming or removing it. + +## 2. Establish the behavior baseline + +Run the narrowest relevant existing checks first, then broader baseline checks when practical. + +Examples: + +- backend unit/API tests; +- frontend component/integration tests; +- route/auth/error-contract tests; +- migration status/upgrade checks; +- lint/type/build checks; +- visual/browser checks when the refactor touches rendered behavior; +- CLI/management-command checks; +- fixture/serialization checks. + +Record: + +- commands/checks actually run; +- pass/fail counts where available; +- pre-existing failures/warnings; +- environment limitations; +- anything important that cannot be validated. + +Do not normalize a failing baseline into "passed" after the refactor. The goal is **no new regression**, unless the accepted task explicitly includes correcting a known failure. + +## 3. Add characterization coverage when needed + +If important current behavior lacks adequate tests, add the smallest useful characterization test before changing structure. + +A characterization test should capture an observable contract, such as: + +- API input/output/status behavior; +- auth/authorization behavior; +- component prop/state/render behavior; +- ordering/filtering/calculation behavior; +- serialization/persistence behavior; +- error handling; +- important side effects. + +Do not lock tests to incidental implementation details merely to make refactoring impossible. Protect behavior, not private structure. + +## 4. Plan the smallest coherent refactor + +Prefer a short sequence such as: + +1. add/confirm coverage; +2. extract one function/component/service; +3. redirect existing callers; +4. validate; +5. remove now-dead duplication; +6. validate; +7. repeat only if needed to meet the accepted objective. + +For larger refactors, explicitly identify safe intermediate states. Avoid "delete old architecture, build new architecture, then see if tests pass" when incremental migration is practical. + +## 5. Refactor by layer + +### React/frontend + +Preserve unless explicitly authorized: + +- route paths and navigation behavior; +- component public props; +- form field names/submission payloads; +- state ownership semantics; +- loading/error/empty/success behavior; +- CSS class/module contracts relied on by tests or layout; +- accessibility behavior; +- API request/response expectations. + +Typical safe operations include extracting presentational components, hooks, helpers, repeated form logic, API adapters, or state selectors while preserving external contracts. + +Do not convert state-management approaches, change UI libraries, redesign pages, or alter UX as incidental cleanup. + +### Flask/backend + +Preserve unless explicitly authorized: + +- route URLs/methods; +- request and response contracts; +- status/error semantics; +- auth/authorization checks; +- transaction boundaries and side effects; +- model/data semantics; +- configuration keys; +- CLI/management command behavior. + +Typical safe operations include extracting service/helper functions, consolidating validation, splitting oversized route modules, clarifying domain boundaries, or removing proven duplication while retaining route contracts. + +Do not rewrite migrations or change schema merely because a model/module is being reorganized. + +### Shared/API boundary + +When moving code across layers, verify both ends of the contract. A refactor is not safe merely because one side compiles. + +Check: + +- field names/types; +- optional/null handling; +- status/error shapes; +- auth headers/cookies/tokens; +- pagination/filter/sort semantics; +- date/time representation; +- identifiers and ordering; +- side effects and retries. + +### Runtime/infrastructure/config + +Refactoring app structure may require import/path/config updates, but preserve runtime behavior. Treat Docker, Gunicorn, nginx/SWAG, environment variables, startup commands, CI, scripts, and deployment wiring as public contracts when they consume the refactored paths. + +## 6. Validate after each meaningful change + +Use targeted checks during the refactor rather than waiting until the end. + +Examples: + +- relevant test file/module; +- import/compile check after moving Python modules; +- component test after extraction; +- lint/type check after interface changes; +- focused API contract tests after moving validation/business logic. + +If a step introduces a regression, resolve it before stacking more structural changes on top. + +## 7. Remove dead code only when proven dead + +Before deleting old functions/files/exports: + +- search all imports/references; +- check dynamic registration/configuration; +- inspect tests/scripts/migrations/CLI/runtime entry points; +- account for external/public interfaces documented by the project; +- verify the replacement path is live. + +"No obvious reference in one file" is not sufficient evidence. + +## 8. Final validation + +At completion: + +1. run targeted tests for the changed area; +2. run the repository's appropriate broader test suite; +3. run lint/type/build checks that apply; +4. run migration/config/runtime checks if touched; +5. run visual/browser checks if rendered behavior may have changed; +6. inspect the final diff for accidental churn; +7. compare final results to the baseline. + +Use `references/behavior-preservation-checklist.md` and `references/refactor-validation.md` when useful. + +If full validation is blocked, report exactly what passed, what failed, and what could not run. Do not mark behavioral equivalence as fully verified when required checks were unavailable. + +## 9. Handling behavior changes discovered during refactoring + +If behavior changes accidentally: + +- revert or correct the refactor step when the change is outside scope; +- add regression coverage if the previous contract was inadequately protected; +- do not rationalize an accidental change as "better". + +If the old behavior appears defective or undesirable: + +- preserve it for the refactor unless fixing it is explicitly in scope; +- record the verified issue according to the project context system; +- propose/separate a bug/feature task as appropriate; +- do not silently bundle the fix into the refactor. + +If preserving old behavior is impossible because the accepted structural change necessarily alters a public contract, stop and obtain/record the required decision before proceeding. + +## 10. Context-system interaction + +In BortStack projects: + +- confirm the refactor task is accepted/in scope before substantial changes; +- respect existing ADR/PDR/task decisions; +- update the project’s current-state record only if verified architectural/current-state truth materially changes; +- add a durable decision only when the refactor establishes a meaningful project-wide architectural contract, not for every extraction/rename; +- update task status based on actual validation; +- refresh the project’s handoff record when useful for continuation; +- do not invent follow-on accepted work from incidental findings. + +A task whose code changes are complete but required validation is blocked should remain in the repository's appropriate blocked/in-progress state rather than being falsely completed. + +## Completion report + +When useful, report concisely: + +1. refactor objective and preserved behavior boundary; +2. repository/context evidence inspected; +3. baseline validation results; +4. files changed; +5. structural changes made; +6. characterization/regression tests added or changed; +7. final validation results compared with baseline; +8. any behavior differences discovered; +9. anything not verified; +10. final task/context status. + +Do not advertise internal cleanup as a user-facing feature. Do not claim behavior was preserved unless evidence supports that conclusion. diff --git a/skills/safe-refactor/agents/openai.yaml b/skills/safe-refactor/agents/openai.yaml new file mode 100644 index 0000000..c43b197 --- /dev/null +++ b/skills/safe-refactor/agents/openai.yaml @@ -0,0 +1,18 @@ +interface: + display_name: safe refactor + short_description: Use when Codex needs to restructure, simplify, extract, rename, + consolidate, modularize, or clean up existing web-application code while preserving + observable behavior; especially for React components/hooks/state, Flask routes/services/models, + duplicated logic, large modules, testability improvements, dependency boundaries, + or architecture cleanup where the goal is safer maintainability rather than new + functionality. Establish a behavior baseline, make small reversible changes, validate + continuously, avoid opportunistic scope, and report any behavior that changes. + icon_small: assets/icon.svg + icon_large: assets/icon.svg +policy: + products: + - chatgpt + - codex + - api + - atlas + allow_implicit_invocation: true diff --git a/skills/safe-refactor/assets/icon.svg b/skills/safe-refactor/assets/icon.svg new file mode 100644 index 0000000..c782ded --- /dev/null +++ b/skills/safe-refactor/assets/icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/skills/safe-refactor/references/behavior-preservation-checklist.md b/skills/safe-refactor/references/behavior-preservation-checklist.md new file mode 100644 index 0000000..2abde54 --- /dev/null +++ b/skills/safe-refactor/references/behavior-preservation-checklist.md @@ -0,0 +1,34 @@ +# Behavior Preservation Checklist + +Use only the sections relevant to the refactor. + +## Public/API contracts +- Route paths and HTTP methods unchanged unless authorized. +- Request fields, defaults, validation semantics, and content types unchanged. +- Response fields/types/status codes/error shapes unchanged. +- Authentication and authorization requirements unchanged. +- Pagination/filter/sort/order semantics unchanged. + +## Frontend contracts +- Route/navigation behavior unchanged. +- Public component props/events unchanged where callers depend on them. +- Loading, empty, error, success, disabled, and validation states preserved. +- Forms submit the same domain payloads and retain required accessibility behavior. +- Existing approved visual behavior is not redesigned incidentally. + +## Data/persistence +- Schema unchanged unless explicitly part of scope. +- Existing rows retain the same meaning. +- Transaction/commit/rollback behavior remains equivalent. +- Serialization/deserialization behavior remains equivalent. +- Migration history is not rewritten. + +## Runtime/integration +- Environment/configuration names unchanged. +- Startup/import/entry-point paths remain valid. +- Docker/Gunicorn/nginx/CI/scripts consuming moved code are updated safely. +- External-service contracts and side effects are preserved. + +## Operational +- No branch switches, commits, pushes, deploys, resets, or destructive state changes without authority. +- No unrelated dependency churn or generated-file noise. diff --git a/skills/safe-refactor/references/refactor-validation.md b/skills/safe-refactor/references/refactor-validation.md new file mode 100644 index 0000000..96f6672 --- /dev/null +++ b/skills/safe-refactor/references/refactor-validation.md @@ -0,0 +1,37 @@ +# Refactor Validation + +A safe refactor should be evaluated against its **pre-change baseline**, not only against an ideal green suite. + +## Before +Record, where available: +- targeted test results; +- broader test results; +- lint/type/build results; +- browser/visual state if relevant; +- migration/config/runtime checks if relevant; +- known existing failures and warnings. + +## During +After each meaningful structural step: +- run the narrowest relevant test/check; +- verify imports/exports/routes/registration still resolve; +- inspect unexpected diff/churn; +- stop and correct regressions before continuing. + +## After +Run the strongest practical combination of: +- targeted tests; +- broader backend/frontend tests; +- lint/type/build; +- API contract tests; +- migration/config/startup checks; +- visual/browser checks where rendered behavior could change; +- `git diff --check` or repository equivalent; +- final reference/search check before deleting old symbols/files. + +## Result classification +- **Verified preserved:** required checks ran and no behavioral regression was found. +- **Preserved with known baseline failures:** no new failures beyond documented pre-existing ones. +- **Partially verified:** some required checks were unavailable; state exactly which. +- **Behavior changed:** identify the exact observable difference and whether it is authorized. +- **Blocked:** equivalence cannot be established safely with available evidence. diff --git a/skills/webapp-debug/SKILL.md b/skills/webapp-debug/SKILL.md new file mode 100644 index 0000000..5473173 --- /dev/null +++ b/skills/webapp-debug/SKILL.md @@ -0,0 +1,324 @@ +--- +name: webapp-debug +description: Use when Codex needs to diagnose and fix a web-application defect whose root cause is not yet known, especially across React/frontend behavior, browser console/network requests, Flask/backend routes, authentication/authorization, relational data, migrations, Docker/reverse-proxy/runtime configuration, tests, or logs; when the goal is to reproduce the failure, gather evidence, isolate the smallest root cause, implement a minimal fix, add regression coverage, validate the result, and avoid speculative or unrelated changes. +--- + +# Webapp Debug + +Version: **2.0**. + +Diagnose before changing code. Reproduce the reported failure, trace it through the application's actual architecture, identify evidence-backed root cause, make the smallest coherent fix, prove the regression where practical, and stop. + +This skill is designed to compose with `bortstack-context`. The context skill owns project/task/decision/handoff semantics; this skill owns the debugging workflow. If diagnosis shows the request is actually a new feature or broad refactor rather than a defect, stop and switch workflows instead of stretching debugging into unrelated implementation. + +## Repository workflow + +In a BortStack project, use `bortstack-context` with the applicable repository `AGENTS.md` before task work. They govern scope and authorisation, branch/worktree policy, lifecycle, manual acceptance, and handoff. Find the maintained overview, current state, decisions, task and handoff records through repository instructions and layout. Use the paths and task IDs the project already uses. Follow context's canonical discussion, mission and lifecycle guidance when interpreting authority or changing task status. If a required BortStack skill is unavailable, report the dependency. If an installed skill lacks a required reference, use the reference from a verified Forge package with a matching manifest. If the required guidance is unavailable, pause the affected action. + +For edits, inspect Git status and worktrees, confirm authorised scope and the source candidate, and follow the current branch policy. Use direct integration-branch work where authorised and a dedicated branch/worktree where required. Preserve unrelated work. Read-only specialist work does not require a new worktree. When acting as an authorised contributor, use `bortstack-contributor` for contributor permissions, finalisation and submission. For ordinary specialist work, use the project's normal authority. + +When manual testing is relevant, discover the documented commands, configuration and hooks in the target repository. Use its supported workflow, including an existing `testtask` wrapper and its project-specific config or hook where documented. Preserve a working adapter and its supported invocation. Before use, inspect its supported arguments, candidate handling, runtime and cleanup behavior. If no adapter is required, use the established development environment. Record candidate identity, actual checks, limitations and pending human acceptance in the project's handoff. Refresh stale candidates after edits and make fixes in the authoritative source. A source snapshot, wrapper, automated check or startup alone does not establish a manual pass. Follow context and repository rules for task transitions and closure. + +Outside BortStack, follow the repository's own scope, branch, test and reporting conventions and proceed with the specialist workflow. BortStack skills and records are optional there. + +## Core rules + +1. **Read repository instructions and context first.** Obey root/nested `AGENTS.md`, current-state/task/decision rules, and repository-specific validation requirements. +2. **Reproduce before fixing whenever practical.** A symptom report is a lead, not proof of root cause. Establish the failing behavior or the strongest available evidence before editing. +3. **Separate symptom, hypothesis, evidence, and conclusion.** Do not present a guess as a diagnosis. +4. **Trace the actual request/data path.** For web apps this commonly means browser/UI → client state/API call → proxy/network → Flask route/auth/validation → domain/data layer → database/external dependency → response → frontend rendering. +5. **Change the smallest layer that is actually wrong.** Do not paper over a backend defect in the frontend, weaken authorization to make a request work, or add retries/timeouts without evidence they address the cause. +6. **Preserve unrelated behavior.** Avoid cleanup, redesign, dependency churn, renames, architecture migration, or opportunistic fixes while debugging one defect. +7. **Prefer instrumentation and existing observability over speculation.** Use tests, logs, console output, network responses, stack traces, database state, configuration, and neighboring code patterns. +8. **Do not destroy evidence.** Avoid clearing databases/logs/caches, resetting branches, deleting state, regenerating migrations, or restarting/redeploying production systems merely to get a clean slate unless explicitly authorized and safe. +9. **Treat production/external systems conservatively.** Read-only inspection may be appropriate when authorized; mutation, deployment, credential changes, DNS changes, destructive SQL, or service restarts require explicit authority or an existing approved operational workflow. +10. **Add regression coverage when practical.** A bug fix should normally gain a targeted test that fails before the fix and passes after it, or an equivalent reproducible validation when automated coverage is not feasible. +11. **Validate both the fix and its blast radius.** Run targeted checks first, then the relevant broader repository checks. Never claim a check passed if it was not run. +12. **Update durable context after an evidence-backed fix.** Use the repository workflow for task, current state, decisions and handoff updates. +13. **Do not commit, push, switch branches, deploy, provision infrastructure, or start another task unless explicitly requested.** +14. **Stop when the reported defect is resolved or when evidence is insufficient.** Do not turn debugging into general code improvement. + +## Establish the debugging contract + +Before editing, identify: + +- the reported symptom and expected behavior; +- affected user/workflow/environment; +- reproducible steps or triggering conditions; +- whether the issue is deterministic, intermittent, environment-specific, data-specific, or concurrency-sensitive; +- relevant recent changes when repository evidence makes them available; +- the accepted task/incident if the project uses BortStack; +- constraints and non-goals; +- what validation would demonstrate resolution. + +If the report is too vague to identify a testable symptom, gather repository/runtime evidence first. Ask the user only for information that cannot be recovered from available code, logs, tests, configuration, or supplied artifacts. + +Do not invent timestamps, production state, user actions, credentials, or request payloads. + +## 1. Reproduce or establish the failure + +Prefer the smallest reliable reproduction. + +Depending on the defect, use one or more of: + +- an existing failing automated test; +- a new minimal regression test written against the current behavior; +- a local browser reproduction; +- frontend unit/component interaction reproduction; +- direct API request against a safe local/test environment; +- a migration/database fixture reproducing the data condition; +- supplied stack trace/log/network capture; +- repository evidence that deterministically proves the defect. + +Record the exact observed failure: status code, exception, assertion, wrong value, UI state, network response, log entry, or other concrete signal. + +If the issue cannot be reproduced: + +1. verify the stated environment and prerequisites; +2. inspect logs/tests/recent relevant changes; +3. narrow likely conditions without changing behavior; +4. report what was and was not reproduced. + +Do **not** make a speculative code change merely because it might help. + +## 2. Map the failing path + +Trace only the code/configuration needed to explain the symptom. + +### Frontend/browser + +Inspect when relevant: + +- route and component entry point; +- event handler/form submission; +- state/context/store lifecycle; +- request construction and API client; +- loading/error/empty/success rendering; +- browser console errors; +- network URL, method, headers, payload, status, response body; +- stale closure/effect/dependency/race behavior; +- asset/build/runtime configuration. + +### HTTP/proxy/runtime boundary + +Inspect when relevant: + +- request host/path/protocol; +- CORS/CSRF/cookie/token behavior; +- nginx/SWAG/reverse-proxy rules; +- container/service names and ports; +- health/readiness state; +- environment variable wiring; +- timeouts/body-size/upload limits; +- DNS/TLS only when the symptom reaches those layers. + +### Flask/backend + +Inspect when relevant: + +- route registration and method/path; +- authentication and authorization; +- request parsing and validation; +- error handlers/status conventions; +- domain/service logic; +- serialization; +- database transaction lifecycle; +- external API/email/storage client behavior; +- exception/logging path. + +### Database/migrations/data + +Inspect when relevant: + +- model/schema versus migration state; +- constraints, nullability, uniqueness, foreign keys and indexes; +- query/filter/join behavior; +- transaction/locking/concurrency behavior; +- fixture/data assumptions; +- migration ordering/version state; +- database-engine differences between test/dev/production. + +Search for consumers before modifying a shared helper, model field, endpoint contract, environment variable, or component API. + +Use `references/debug-evidence-checklist.md` when the defect crosses multiple layers. + +## 3. Form ranked hypotheses + +After reproduction and path inspection, form the smallest set of plausible hypotheses supported by evidence. + +For each important hypothesis, identify: + +- evidence supporting it; +- evidence that would falsify it; +- the cheapest safe check to discriminate it from alternatives. + +Test hypotheses rather than making several unrelated changes at once. Prefer one discriminating observation over broad instrumentation churn. + +Examples of useful discriminators: + +- request never leaves browser vs backend returns error; +- route not registered vs authorization rejects it; +- application validation vs database constraint failure; +- stale frontend state vs wrong API response; +- code defect vs environment/config mismatch; +- migration absent vs schema/model mismatch; +- deterministic logic bug vs race/concurrency issue. + +## 4. Identify root cause + +Call something the root cause only when the evidence explains the observed symptom and the reproduction path. + +A useful root-cause statement is specific, for example: + +> The PATCH route accepts an empty `name` because it bypasses the create/update validation helper; the database permits the empty string, so the request succeeds and the UI later renders a blank service name. + +Avoid vague conclusions such as “state issue”, “CORS problem”, “database bug”, or “React timing”. + +If multiple independent defects contribute, distinguish primary cause from secondary/contributing conditions. Do not silently expand scope to fix every contributing weakness. + +## 5. Design the minimal fix + +Choose the smallest coherent change that removes the root cause at the authoritative layer. + +Guidelines: + +- validation/invariant defects belong at the backend/database boundary as appropriate, not only in UI guards; +- authorization defects must preserve server-side enforcement and the project's existing auth model; +- frontend rendering/state defects should not require backend contract changes unless the backend contract is actually wrong; +- proxy/config defects should use existing operational conventions rather than application workarounds; +- data/schema defects require an explicit migration/data-safety assessment; +- race conditions require atomicity/locking/constraints appropriate to the existing architecture, not timing sleeps; +- flaky tests should be debugged for the actual race/assumption rather than simply increasing arbitrary waits. + +Before editing, check whether the proposed fix changes a durable product/API/data/security decision. If it does, use the context decision workflow instead of silently choosing a new behavior. + +## 6. Capture the regression + +When feasible, create or identify a test that demonstrates the bug before the fix. + +A good regression test: + +- exercises the observed behavior, not a private implementation detail; +- fails for the root cause you identified; +- passes after the minimal fix; +- protects the boundary most likely to regress; +- does not require weakening or deleting unrelated tests. + +Depending on the issue, this may be: + +- Flask/API test; +- model/database test; +- React unit/component test; +- browser/end-to-end test; +- migration test; +- configuration validation; +- deterministic reproduction script/command when automated test infrastructure is unsuitable. + +If a regression test cannot reasonably be added, explain why and document the concrete manual/runtime reproduction used instead. + +Before editing, confirm the repair is authorised and apply the repository workflow to the source checkout. + +## 7. Implement one focused fix + +Make the change with tight scope. + +During implementation: + +- retain useful diagnostic logging only if it belongs in normal operation; +- remove temporary prints, debug endpoints, screenshots, dumps, test credentials, or ad-hoc instrumentation before finishing; +- do not hide exceptions or convert failures into false success; +- do not broaden exception handling merely to suppress the symptom; +- do not disable tests/lint/security controls to get green validation; +- do not upgrade dependencies unless evidence shows the dependency version is the root cause and that upgrade is within scope. + +If the first fix does not resolve the original reproduction, revert/reassess that hypothesis rather than stacking speculative changes. + +## 8. Validate the fix in layers + +Use repository-supported commands and environments as authority. + +A sensible order is: + +1. original reproduction/regression test; +2. neighboring targeted tests; +3. relevant backend/frontend suite; +4. lint/type/static checks affected by the change; +5. production build when frontend/build configuration changed; +6. migration/configuration checks when relevant; +7. browser/runtime reproduction when the defect was user-visible and safe tooling/environment is available; +8. repository-specific completion gates. + +Also verify the **negative path** where relevant: unauthorized request still fails, invalid input still fails, unrelated route still works, stale record still handled, etc. + +Distinguish clearly between: + +- freshly passed checks; +- historical evidence; +- checks blocked by environment/dependency/network/credential limitations; +- manual verification still required. + +Use `references/regression-validation.md` for the final pass. + +## 9. Review the final diff and context + +Before declaring resolution: + +- compare the final behavior with the original reproduction; +- inspect the diff for unrelated cleanup or accidental contract changes; +- check for debug artifacts, secrets, logs/dumps, generated junk, or dependency churn; +- run `git diff --check` when Git is available; +- update the project’s current-state record with the verified defect/resolution where materially useful; +- update the accepted task/incident status according to repository rules; +- record a durable decision only if the fix establishes/changes a durable rule; +- refresh the project’s handoff record when the repository workflow calls for it; +- do not start the next task. + +Report blocked or pending runtime and manual checks. Leave task state to the project’s lifecycle and acceptance rules. + +## Stop conditions + +Stop and report rather than guessing when: + +- the target repository/environment is unavailable or cannot be identified safely; +- the reported failure cannot be reproduced and there is insufficient evidence to identify root cause; +- logs/evidence point to an external system you are not authorized or able to inspect; +- diagnosis requires credentials/secrets the user has not supplied through an appropriate secure mechanism; +- the apparent fix requires destructive data operations, production mutation, deployment, branch reset, or infrastructure changes outside the authorized task; +- resolving the symptom requires an unapproved product/security/data-model decision; +- repository evidence shows the request is actually a new feature or broad refactor; +- available evidence contradicts the user's initial theory: report the evidence and debug the observed defect, not the requested theory. + +A safe evidence-backed stop is preferable to a speculative “fix”. + +## Completion report + +Give a concise debugging report containing: + +1. reported/reproduced symptom; +2. evidence inspected and reproduction method; +3. root cause, with the key evidence supporting it; +4. fix implemented and why that layer was authoritative; +5. files/areas materially changed; +6. regression coverage added/updated; +7. tests and validation actually run, with exact results; +8. anything not verified and why; +9. context/task/decision updates made; +10. final task/incident status and any remaining manual step. + +If no safe root cause/fix was established, say so explicitly and report the narrowed hypotheses/evidence instead of pretending the issue is resolved. + +## When not to use this skill + +Do not use this workflow for: + +- implementing a known, scoped new feature — use `webapp-feature`; +- choosing the next task — use `bortstack-context` in BortStack or the repository’s own planning workflow; +- broad behavior-preserving restructuring — use `safe-refactor`; +- review-only auditing — use `code-review` or `production-readiness-review`; +- deployment/release execution where the code defect is already understood — use `deployment-check`; +- creating a new project — use `roborto-new-project` as the temporary scaffolding route. + +## Resources + +- `references/debug-evidence-checklist.md` — layer-by-layer evidence checklist for tracing web failures. +- `references/regression-validation.md` — concise regression/fix validation checklist. diff --git a/skills/webapp-debug/agents/openai.yaml b/skills/webapp-debug/agents/openai.yaml new file mode 100644 index 0000000..2b06e83 --- /dev/null +++ b/skills/webapp-debug/agents/openai.yaml @@ -0,0 +1,18 @@ +interface: + display_name: webapp debug + short_description: Use when Codex needs to diagnose and fix a web-application defect + whose root cause is not yet known, especially across React/frontend behavior, + browser console/network requests, Flask/backend routes, authentication/authorization, + relational data, migrations, Docker/reverse-proxy/runtime configuration, tests, + or logs; when the goal is to reproduce the failure, gather evidence, isolate the + smallest root cause, implement a minimal fix, add regression coverage, validate + the result, and avoid speculative or unrelated changes. + icon_small: assets/icon.svg + icon_large: assets/icon.svg +policy: + products: + - chatgpt + - codex + - api + - atlas + allow_implicit_invocation: true diff --git a/skills/webapp-debug/assets/icon.svg b/skills/webapp-debug/assets/icon.svg new file mode 100644 index 0000000..c782ded --- /dev/null +++ b/skills/webapp-debug/assets/icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/skills/webapp-debug/references/debug-evidence-checklist.md b/skills/webapp-debug/references/debug-evidence-checklist.md new file mode 100644 index 0000000..39e7cfa --- /dev/null +++ b/skills/webapp-debug/references/debug-evidence-checklist.md @@ -0,0 +1,64 @@ +# Debug Evidence Checklist + +Use only the sections relevant to the observed failure. Evidence beats checklist completion. + +## Reproduction + +- Exact action/request/input that triggers the problem +- Expected versus observed behavior +- Deterministic/intermittent/environment/data-specific? +- Exact error/status/assertion/UI state +- Smallest safe reproduction available + +## Browser / React + +- Console exception/warning +- Network URL/method/headers/payload/status/body +- Route/component involved +- State/context/store values and lifecycle +- Loading/error/empty/success branches +- Effects, dependencies, stale closure, duplicate request, race + +## HTTP / Proxy / Runtime + +- Host/path/protocol +- Cookie/token/CORS/CSRF behavior +- Reverse-proxy route and service/port +- Container/process health +- Relevant environment variables (names/configuration, never expose secrets) +- TLS/DNS only if evidence reaches those layers + +## Flask / Backend + +- Route registration and method +- Authentication/authorization result +- Request parsing/validation +- Error handler/exception +- Domain/service behavior +- Serialization/response contract +- Transaction lifecycle +- External client result + +## Database / Migration + +- Current model versus migration/schema +- Constraint/query/relationship behavior +- Fixture/data condition +- Transaction/locking/concurrency +- Engine/version/environment differences + +## Repository History / Context + +- Relevant task/decision/current-state constraint +- Neighboring implementation pattern +- Recent relevant diff/commit when available +- Existing regression tests + +## Evidence discipline + +Keep separate: + +- **Observed:** directly reproduced/read from evidence. +- **Hypothesis:** plausible explanation not yet proven. +- **Root cause:** evidence-backed explanation that accounts for the symptom. +- **Fix:** minimal change addressing that root cause. diff --git a/skills/webapp-debug/references/regression-validation.md b/skills/webapp-debug/references/regression-validation.md new file mode 100644 index 0000000..7a2f1aa --- /dev/null +++ b/skills/webapp-debug/references/regression-validation.md @@ -0,0 +1,16 @@ +# Regression Validation + +Before declaring a defect fixed: + +1. Re-run the exact original reproduction. +2. Run the new/updated regression test and confirm it passes. +3. Run nearby tests that protect the same contract. +4. Verify important negative behavior still holds (auth, validation, error path, constraints). +5. Run repository-required lint/static/build/migration checks relevant to the change. +6. Reproduce in the relevant browser/runtime when practical and safe. +7. Inspect the final diff for unrelated changes and temporary diagnostics. +8. Run `git diff --check` when Git is available. +9. Distinguish fresh validation from historical evidence and unavailable checks. +10. Report blocked runtime or manual checks and follow the project’s lifecycle before closing the task. + +For intermittent defects, one successful run is weak evidence. Use a deterministic regression when possible or repeat the triggering scenario enough to support the claim without pretending probabilistic evidence is certainty. diff --git a/skills/webapp-feature/SKILL.md b/skills/webapp-feature/SKILL.md new file mode 100644 index 0000000..dd51525 --- /dev/null +++ b/skills/webapp-feature/SKILL.md @@ -0,0 +1,230 @@ +--- +name: webapp-feature +description: Use when Codex needs to implement one scoped web-application feature or accepted task end-to-end in an existing project, especially across React/frontend, Flask/backend, relational database/migrations, API contracts, tests, and documentation; when the goal is to preserve the existing architecture and behavior outside the requested feature; or when a feature should be delivered as a small validated change rather than a broad refactor. +--- + +# Webapp Feature + +Version: **2.0**. + +Implement one agreed web-application feature safely, minimally, and end-to-end. Work with the repository's existing architecture instead of redesigning the application around the task. + +This skill is designed to compose with `bortstack-context`. The context skill owns project/task/decision/handoff semantics; this skill owns the implementation workflow for the feature itself. + +## Repository workflow + +In a BortStack project, use `bortstack-context` with the applicable repository `AGENTS.md` before task work. They govern scope and authorisation, branch/worktree policy, lifecycle, manual acceptance, and handoff. Find the maintained overview, current state, decisions, task and handoff records through repository instructions and layout. Use the paths and task IDs the project already uses. Follow context's canonical discussion, mission and lifecycle guidance when interpreting authority or changing task status. If a required BortStack skill is unavailable, report the dependency. If an installed skill lacks a required reference, use the reference from a verified Forge package with a matching manifest. If the required guidance is unavailable, pause the affected action. + +For edits, inspect Git status and worktrees, confirm authorised scope and the source candidate, and follow the current branch policy. Use direct integration-branch work where authorised and a dedicated branch/worktree where required. Preserve unrelated work. Read-only specialist work does not require a new worktree. When acting as an authorised contributor, use `bortstack-contributor` for contributor permissions, finalisation and submission. For ordinary specialist work, use the project's normal authority. + +When manual testing is relevant, discover the documented commands, configuration and hooks in the target repository. Use its supported workflow, including an existing `testtask` wrapper and its project-specific config or hook where documented. Preserve a working adapter and its supported invocation. Before use, inspect its supported arguments, candidate handling, runtime and cleanup behavior. If no adapter is required, use the established development environment. Record candidate identity, actual checks, limitations and pending human acceptance in the project's handoff. Refresh stale candidates after edits and make fixes in the authoritative source. A source snapshot, wrapper, automated check or startup alone does not establish a manual pass. Follow context and repository rules for task transitions and closure. + +Outside BortStack, follow the repository's own scope, branch, test and reporting conventions and proceed with the specialist workflow. BortStack skills and records are optional there. + +## Core rules + +1. **Read repository instructions first.** Obey root and nested `AGENTS.md` files and any project-specific engineering rules. +2. **Use repository evidence, not assumptions.** Inspect the relevant source, configuration, migrations, tests, and existing neighboring features before deciding how to implement the change. +3. **Work from one scoped outcome.** Prefer one accepted task or one explicit sufficiently-scoped user request. Do not silently expand a feature into a redesign or backlog. +4. **Preserve unrelated behavior.** Make the smallest coherent change that satisfies the acceptance criteria. Avoid unrelated cleanup, renames, dependency churn, style rewrites, or architectural migration. +5. **Follow existing patterns unless they are the problem being changed.** Match established route/model/service/component/state/test conventions when they remain valid. +6. **Do not invent product behavior.** If a material business rule, authorization rule, data constraint, or UX behavior is unresolved, stop at the decision boundary and surface it instead of guessing. +7. **Treat data changes carefully.** Model/schema changes require a migration strategy appropriate to the repository. Never edit production data or run destructive migrations merely to complete a local feature unless explicitly authorized. +8. **Keep API contracts coherent.** Backend validation, authorization, serialization, status codes, frontend expectations, and tests must agree. +9. **Validate what changed.** Run the narrowest useful checks first, then the broader repository-required checks. Never claim a check passed if it was not run. +10. **Update durable project context after implementation.** When the repository uses BortStack, use its task/current-state/decision/handoff rules rather than duplicating them here. +11. **Do not commit, push, switch branches, deploy, provision infrastructure, or mutate external services unless explicitly requested or required by an already-authorized project workflow.** +12. **Stop when the feature is complete.** Do not use spare time/tokens to start the next task. + +## Preconditions + +Before editing, establish: + +- the requested outcome; +- the matching accepted task or explicit scoped request; +- acceptance criteria; +- constraints and non-goals; +- relevant durable decisions; +- affected surfaces: database, backend, API, frontend, tests, configuration, external services; +- required validation. + +If the project uses BortStack, read the applicable context first. If the user asks to "work on the next task", task selection belongs to `bortstack-context` before this implementation workflow begins. + +If the request is materially ambiguous, do not manufacture acceptance criteria. Record/propose the missing decision or ask only the question needed to unblock implementation. + +For design-dependent BortStack work, confirm the approved design reference and version or the recorded explicit override through `bortstack-context`. Route unresolved concept, approval, or design handoff work to `bortstack-design`. Use `frontend-ui-design` for component and interaction details within the approved direction. + +For an application feature, identify the authoritative application, real entry point, navigation, auth/state and backend/data needs before editing. Validate the feature through that route in the established development environment and record unverified requirements. Keep a standalone preview within explicitly approved prototype scope. + +## 1. Inspect before planning + +Inspect the smallest useful slice of the repository that proves how the feature should fit. + +Typical evidence includes: + +- neighboring models and migrations; +- route registration and existing endpoints; +- authorization/authentication helpers; +- serializers/schema/validation conventions; +- service/domain modules when present; +- React routing and neighboring pages/components; +- shared API/client/state/context hooks; +- form/error/loading-state conventions; +- relevant tests and fixtures; +- configuration/environment examples when the feature depends on them. + +Do not read every file in a large repository merely to appear thorough. Trace the feature through the existing architecture. + +Before changing a public or shared contract, search for its consumers. + +## 2. Form a minimal implementation plan + +Plan the change in dependency order. A typical cross-stack feature may be: + +1. durable business/data rule; +2. model/schema change and migration; +3. backend/domain behavior; +4. API validation, authorization, and response contract; +5. frontend data integration/state; +6. UI and user-visible states; +7. targeted tests; +8. broader validation; +9. context/documentation update. + +Not every feature needs every layer. Do not create abstractions, services, endpoints, state stores, or components merely to match this list. + +If implementation reveals a decision that would materially change scope or architecture, stop and resolve/record that decision before proceeding. + +## 3. Database and migration work + +When persistence changes: + +- follow the repository's ORM/schema conventions; +- encode important integrity rules in the strongest appropriate layer rather than relying only on UI checks; +- consider uniqueness, nullability, foreign keys, deletion behavior, indexes, defaults, and concurrency where relevant; +- generate/write a migration using the project's established migration tooling; +- review generated migrations rather than trusting them blindly; +- avoid destructive operations unless they are explicitly required and safely planned; +- keep migrations forward-compatible with the repository's supported deployment process; +- add migration/schema tests when the project convention requires them. + +For race-sensitive behavior such as booking, inventory, quotas, or one-time claims, do not assume a frontend availability check prevents concurrent writes. Use database/application guarantees appropriate to the architecture. + +## 4. Backend and API work + +For backend behavior: + +- enforce authentication and authorization server-side; +- validate untrusted input at the backend boundary; +- keep business invariants out of the frontend-only layer; +- reuse established error and response conventions; +- return deliberate HTTP status codes and safe error bodies; +- avoid leaking internal exceptions, secrets, or sensitive data; +- preserve existing endpoint behavior unless the task explicitly changes it; +- update API consumers/tests when a contract intentionally changes. + +Prefer the project's existing structure. Do not introduce a repository/service/domain layer solely because another project uses one. + +## 5. Frontend work + +For React/frontend behavior: + +- follow existing routing, component, state, styling, and API-client conventions; +- preserve established visual/design-system authority when the repository defines one; +- implement the complete user-visible state, not only the happy path; +- handle loading, empty, success, validation, authorization, and failure states where relevant; +- prevent obvious duplicate submissions or stale UI when the existing architecture supports it; +- keep client-side validation aligned with, but never a substitute for, backend validation; +- avoid redesigning neighboring screens unless required by the accepted feature. + +If a requested visual treatment conflicts with a documented canonical design, surface the conflict instead of silently redesigning it. + +## 6. Tests while implementing + +Add or update tests close to the behavior being changed. + +Prefer tests that prove observable requirements rather than implementation details. Depending on the feature, cover: + +- authorized and unauthorized paths; +- valid and invalid input; +- important domain constraints; +- success and failure responses; +- database integrity/concurrency-sensitive behavior where practical; +- frontend rendering and interaction states; +- regression cases for the bug/behavior motivating the change. + +Do not delete or weaken a valid test merely to make the new implementation pass unless the accepted behavior intentionally changed; in that case update the test and durable decision/task context accordingly. + +## 7. Validate in layers + +Use the repository's own commands as authority. A sensible order is: + +1. targeted test(s) for changed behavior; +2. relevant backend/frontend test suite; +3. lint/type/static checks used by the project; +4. production build when frontend/build configuration changed; +5. migration/configuration validation when applicable; +6. browser/visual/runtime verification when the feature has user-facing behavior and the environment/tools support it; +7. repository-specific completion gates. + +Do not install unrelated tools or change runtime versions merely to force validation. If a check cannot run, report the exact blocker and distinguish fresh validation from historical evidence. + +Warnings are not automatically failures, but report material pre-existing or newly introduced warnings honestly. Do not claim the feature is fully verified if a required layer remains untested. + +Use `references/validation-matrix.md` as a checklist when the feature crosses several layers. + +## 8. Scope-control checkpoints + +Stop and surface the issue instead of continuing when: + +- the requested behavior conflicts with a durable decision; +- implementing the feature requires choosing an unresolved product/business rule; +- a migration would be destructive or require production-data assumptions; +- the apparent fix requires a broad architectural refactor not accepted by the task; +- a security/authorization requirement is unclear; +- an external dependency/credential/infrastructure change is required but not authorized; +- repository evidence contradicts the task enough that acceptance criteria are no longer trustworthy. + +A discovered unrelated defect should normally be documented according to the project's context rules, not fixed opportunistically. + +## 9. Finish the feature + +Before declaring completion: + +- compare the implementation against every acceptance criterion; +- inspect the final diff for unrelated changes, debug artifacts, secrets, generated junk, or accidental dependency churn; +- run `git diff --check` when Git is available; +- update the maintained records according to the repository workflow; +- do not mark a task Complete when repository-specific rules require manual/user confirmation that has not happened; +- leave the repository ready for the next session, but do not start the next task. + +## Completion report + +Give a concise engineering report containing: + +1. feature/task implemented; +2. important behavior added or changed; +3. files/areas materially changed; +4. migration/API/UI implications when relevant; +5. tests and validation actually run, with results; +6. anything not verified and why; +7. context/task/decision updates made; +8. remaining blocker or required manual verification, if any. + +Do not pad the report with every file touched when a short area-level summary is clearer. + +## When not to use this skill + +Do not use this workflow for: + +- choosing the next task without implementation — use `bortstack-context` in BortStack or the repository’s own planning workflow; +- creating a new application — use `roborto-new-project` as the temporary scaffolding route; +- diagnosis where the root cause is unknown — use `webapp-debug` first; +- broad behavior-preserving restructuring — use `safe-refactor`; +- a review-only request — use `code-review` or `production-readiness-review` as appropriate; +- deployment-only work — use `deployment-check`. + +## Resources + +- `references/validation-matrix.md` — layer-by-layer validation prompts for common feature shapes. +- `references/feature-checklist.md` — concise implementation and scope-control checklist. diff --git a/skills/webapp-feature/agents/openai.yaml b/skills/webapp-feature/agents/openai.yaml new file mode 100644 index 0000000..d1ca896 --- /dev/null +++ b/skills/webapp-feature/agents/openai.yaml @@ -0,0 +1,17 @@ +interface: + display_name: webapp feature + short_description: Use when Codex needs to implement one scoped web-application + feature or accepted task end-to-end in an existing project, especially across + React/frontend, Flask/backend, relational database/migrations, API contracts, + tests, and documentation; when the goal is to preserve the existing architecture + and behavior outside the requested feature; or when a feature should be delivered + as a small validated change rather than a broad refactor. + icon_small: assets/icon.svg + icon_large: assets/icon.svg +policy: + products: + - chatgpt + - codex + - api + - atlas + allow_implicit_invocation: true diff --git a/skills/webapp-feature/assets/icon.svg b/skills/webapp-feature/assets/icon.svg new file mode 100644 index 0000000..c782ded --- /dev/null +++ b/skills/webapp-feature/assets/icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/skills/webapp-feature/references/feature-checklist.md b/skills/webapp-feature/references/feature-checklist.md new file mode 100644 index 0000000..c012c4e --- /dev/null +++ b/skills/webapp-feature/references/feature-checklist.md @@ -0,0 +1,25 @@ +# Feature checklist + +## Before edits +- Read repository instructions/context. +- Confirm one scoped outcome and acceptance criteria. +- Inspect neighboring implementation and tests. +- Identify affected layers and durable decisions. +- Identify unresolved business/security/data rules before coding. + +## During implementation +- Make the smallest coherent change. +- Follow existing architecture and conventions. +- Enforce validation/authorization/invariants on the server/database where appropriate. +- Keep frontend/backend contracts aligned. +- Add targeted tests with the behavior. +- Avoid unrelated cleanup and speculative improvements. + +## Before completion +- Check every acceptance criterion. +- Run targeted then broader required validation. +- Review migrations and API contract changes. +- Inspect diff for unrelated changes/secrets/debug artifacts. +- Run `git diff --check` when available. +- Update project context/task/decision/handoff according to the context system. +- Stop; do not begin the next task. diff --git a/skills/webapp-feature/references/validation-matrix.md b/skills/webapp-feature/references/validation-matrix.md new file mode 100644 index 0000000..d02306d --- /dev/null +++ b/skills/webapp-feature/references/validation-matrix.md @@ -0,0 +1,19 @@ +# Feature validation matrix + +Use only the rows relevant to the feature and the repository. Repository-specific commands and completion gates take precedence. + +| Surface changed | Minimum useful evidence | Common additional validation | +|---|---|---| +| Domain/business rule | focused unit/integration test proving invariant | invalid/boundary/concurrency cases | +| ORM/model/schema | model/schema test or migration review | upgrade on disposable DB, constraint/index verification | +| API endpoint | authorized success + validation/error tests | unauthorized/forbidden/not-found/conflict cases | +| Authentication/authorization | server-side access-control test | role boundaries, token/session edge cases | +| React component/page | focused render/interaction test | loading/empty/error/disabled states | +| Frontend API integration | mocked/integration request behavior | stale/failed response and retry/submission behavior | +| Routing/navigation | route/render test | protected-route/404/back-navigation behavior | +| Styling/layout | relevant component/page render | browser widths, overflow, keyboard/focus checks | +| Build/config | config-specific test/check | production build, safe env-example review | +| Cross-stack feature | targeted backend + frontend tests | local smoke/browser flow when available | +| Migration/deployment-sensitive change | migration review + repository migration check | disposable upgrade/rollback only when supported and safe | + +Always report the actual environment used when it materially differs from the repository-supported environment.