brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
accelint-onboard-agentsOnboard a repository to agent-driven development by creating or refreshing a complete AGENTS.md or CLAUDE.md through behavior-focused discovery, structured interviewing, drift-aware updates, conflict-aware synthesis, proportional updates, and preview-before-write review. Use when the user wants to create, replace, refresh, import, restructure, append to, dr…
Independent GitHub snapshot · Automated classification · Original documentation governs
openspec/config.yml or openspec/config.yaml project DNA. Do not use it for OpenSpec config onboarding, architecture docs, or one-line AGENTS.md or CLAUDE.md edits that do not require discovery, synthesis, or section-level review.
license: Apache-2.0
metadata:
author: accelint
version: "1.7.0"Guide the user through a conversational interview that produces a complete, project-specific AGENTS.md or CLAUDE.md for how an AI coding agent should behave in this repository.
This skill produces the behavior layer of the agent instruction stack.
Keep content here only when it directly improves recurring agent behavior. If a detail is better described as project background, stack fact, architecture explanation, process handbook material, or nearby reference documentation, use a canonical companion document and link to it instead of restating it here. These layers must not duplicate each other.
Canonical companion documents may include openspec/config.yml or openspec/config.yaml for project DNA, ARCHITECTURE.md for system structure, CONSTRAINTS.md for externally imposed boundaries, EPISTEMIC-MAP.md for validated facts vs open questions and assumptions, and JARGON.md for internal terminology.
Use the rule below to decide what stays in this file and what belongs in a canonical companion document.
If material does not answer "how should the agent behave?", it does not belong in AGENTS.md or CLAUDE.md.
Move that material to the appropriate canonical companion document when one exists, or leave it out.
| Belongs in AGENTS.md | Belongs in a canonical companion document |
|---|---|
"Always run pnpm check before committing" | "Package manager: pnpm" |
| "Use Conventional Commits" | "TypeScript 5.x, strict mode" |
| "Ask before deleting files" | "Monorepo: Turborepo + PNPM" |
| "Prefer small, focused PRs" | "type over interface" |
| "Work as a senior TS engineer when useful" | "Domain: geospatial visualization" |
| "Never force-push to main" | "Testing: Vitest + @testing-library" |
"Read ARCHITECTURE.md before changing deployment-related code" | "Service topology and deployment model" |
"Check CONSTRAINTS.md before changing compliance-sensitive flows" | "The actual compliance or stakeholder constraint itself" |
Only include guidance in the final AGENTS.md or CLAUDE.md when it earns a permanent place. A detail earns that place only when it:
Do not include a detail just because the agent might not know it already. Include it only when it describes a repository-specific rule or exception that affects how the agent should work. Otherwise, leave it out or link to the canonical document that contains it.
Persona or identity framing is optional. Use it only when it improves behavior. Do not let role language replace operational guidance.
commitlint.config.ts exists wastes the user's time. For narrow refreshes, do only the scoped discovery the request needs../assets/template.md cannot be inferred or answered, keep that section and mark unresolved fields with <!-- TODO: fill in --> rather than leaving the section out. Omit optional sections only when ./assets/template.md explicitly allows it. Missing required template sections silently shape agent behavior in unpredictable ways.AGENTS.md or CLAUDE.md exists, package files should reference it and add only what is package-specific. Repeated instructions inflate context on every agent invocation.When candidate rules conflict during import, refresh, or final synthesis, resolve them in this order:
AGENTS.md or CLAUDE.md content that remains consistent with stronger evidence<!-- TODO: fill in --> or an explicit open question instead of forced synthesis when conflict remains unresolvedApply this rule every time:
Follow this workflow in order. Do not skip ahead. Complete each gate before moving to the next step.
Do this before any other workflow step.
Create a progress checklist with your task-tracking tool. If no tool is available, copy the checklist below into your working state or reply. Update it after each completed step or branch handoff.
Important sequencing rule:
If a narrower branch explicitly tells you to skip a later step, follow that branch. Otherwise, keep this order.
Complete Stage 1 before you ask any interview question or enter any mode-specific path.
Before you assess the local file, determine whether the current working directory is a package inside a monorepo.
If a root-level AGENTS.md or CLAUDE.md exists above the current directory:
Read the root file in full.
Announce: "I found a root-level AGENTS.md or CLAUDE.md at [path]. I'll use it as context to avoid duplicating instructions that apply to all packages. The file I generate here will reference the root where appropriate rather than repeating it."
In the generated file, add a header reference:
<!-- Inherits from: [relative path to root AGENTS.md or CLAUDE.md] -->
<!-- Only package-specific overrides and additions are defined here. -->
During the interview, at the start of each turn, state what the root file already covers for that section before asking any questions:
"The root
AGENTS.mdorCLAUDE.mddefines [summary of this section's content].
Emit a reference in the generated file rather than repeating the content. If the user flags additions or overrides, ask the normal turn questions scoped to what is missing or different.
After Step 1 and before local file-state detection, check for canonical companion documents that either:
## Related Documentation section.Check these companion documents in order:
openspec/config.yml or openspec/config.yaml.
## Related Documentation section.openspec/config.yml or openspec/config.yaml — I'll use it to maintain the behavior/project-DNA boundary."ARCHITECTURE.md.
## Related Documentation section.ARCHITECTURE.md — I'll use it when behavior guidance depends on system structure."CONSTRAINTS.md, EPISTEMIC-MAP.md, and JARGON.md.
## Related Documentation section.Apply these limits during this check:
AGENTS.md.Requires: Steps 1 and 2 are complete.
Detect the local AGENTS.md or CLAUDE.md state.
Run this check in order:
AGENTS.md or CLAUDE.md exists in the current directory../assets/template.md, meaning two or more canonical section headings in recognizably template-based form, select Mode 3: Refresh.Treat ./assets/template.md as the canonical structure reference for recognition, refresh, and audit behavior. Use section headings exactly as defined there, preserve the template's canonical order for all required sections, and keep optional headings such as ## Optional review-specific rules and ## Maintenance guidance only when the template allows them.
Use the diagram below as a quick classification aid. The ordered list above is authoritative.
Local `AGENTS.md` or `CLAUDE.md` in current directory?
│
├── No
│ └── MODE 1: Create
│ Full interview from scratch.
│
└── Yes
├── Read the file first
└── Then classify:
├── Empty or near-blank (< about 10 meaningful lines)
│ └── MODE 1: Create
│ Ask: "AGENTS.md exists but appears empty — should I populate it from scratch, or preserve any current content?"
├── Canonical template shape from `./assets/template.md`
│ └── MODE 3: Refresh
│ Two or more canonical section headings in recognizably template-based form.
└── Real content in an unrecognized shape
└── MODE 2: Import
Done when: the file state and detected mode are explicit.
Complete Stage 2 before you start discovery, drift scanning, or any mode-specific interview.
Requires: Step 3 is complete.
If Step 3 detected Mode 2, ask this first:
"Before I start, this file has content that does not follow the canonical template. Would you like to start fresh, treating the existing file as a reference only (recommended for an import), or work with the existing file?"
If Step 3 detected Mode 3, ask this first:
"Before I start, this file already follows the canonical template. Would you like to work with the existing file (recommended for a refresh), or start fresh, treating it as a reference only?"
If the user chooses start fresh, switch immediately to Mode 1: Create.
If the user chooses work with the existing file:
If Step 3 already selected Mode 1, skip Step 4 and Step 5. Go directly to Step 6a.
Done when: the choice between start fresh and work with the existing file is explicit whenever Mode 2 or Mode 3 was detected.
Requires: Step 4 routed here from Mode 2.
Present these three options before you modify or synthesize anything:
"This AGENTS.md has existing content with a structure I don't recognize. How would you like to proceed?
(a) Restructure — I'll import your existing content, map it onto this skill's template sections, flag any material that belongs in a canonical companion document instead, run a targeted interview to fill gaps, and produce a merged file ready to replace the current one.
(b) Append — I'll run the full interview and append a template-aligned
AGENTS.mdblock below your existing content without modifying what's already there.(c) Dry run — I'll run the full interview and show you exactly what I would have generated, with no changes to the filesystem. Use this to evaluate fit before committing."
Branch routing:
Done when: the Mode 2 branch is explicit.
Requires: Step 4 routed here from Mode 3.
Only after the Mode 3 intent gate is satisfied, choose exactly one refresh path:
Branch routing:
Done when: the Mode 3 refresh path is explicit before refresh analysis begins.
Run exactly one Step 6 branch.
Use the interview only after Stages 1 and 2 are complete. Run it conversationally. Do not dump all questions at once. Group questions into natural topic turns that map directly to the canonical template in ./assets/template.md. That template is the source of truth for section names, section order, required-versus-optional sections, placeholder handling, and default scaffolding. If the user describes a workflow, infer related behavioral constraints and confirm them instead of asking again. Keep questions proportional to the request size. Do not ask for information that strong repository evidence already answers.
Ask only for material that belongs in the template. Do not invent extra AGENTS.md sections to hold answers the template does not define. If a topic is optional in the template, confirm whether it should be kept, adapted, or omitted based on what ./assets/template.md allows. When consolidating answers across turns, map them back into the exact canonical sections defined in ./assets/template.md.
Turn 1 — What to optimize for
Turn 2 — How to communicate
Turn 3 — How to work
Turn 4 — Repository-specific commands and entry points
Turn 5 — Decision Heuristics
Turn 6 — Approval and safety boundaries
Turn 7 — Quality bar for finished work
Turn 8 — Optional review-specific rules, related documentation, and maintenance guidance
AGENTS.md to guide code review behavior strongly enough to keep ## Optional review-specific rules, or should that optional section be omitted?## Related Documentation, if they actually exist?## Maintenance guidance, or should the template defaults stand as written?Use Smart Defaults only to reduce avoidable interview load after you have already checked for stronger evidence.
A Smart Default is a confirmation prompt, not standing policy. Use one only when:
Do not use Smart Defaults to introduce new policy, broaden scope, or carry ecosystem assumptions into the generated file.
Apply these rules:
<!-- TODO: fill in --> if the field still cannot be confirmed.Use patterns like these only when they match the repository evidence already gathered.
If the repo appears to use a PNPM monorepo:
If the repo appears to use GitHub Actions for CI:
If the repo appears to use Conventional Commits:
If the repo appears to use OpenSpec or another spec-driven workflow:
AGENTS.md, and which parts should stay in canonical project documentation?"Done when: likely conventions are confirmed, rejected, or replaced with stronger evidence, and no unconfirmed default has been carried into standing guidance.
Use this branch for a fresh repo, an empty or near-blank file that the user wants populated, or an explicit start fresh choice.
Run this branch in order:
Done when: the interview answers and any confirmed smart defaults are ready for gap-filling discovery or the draft is ready for the final editorial pass.
Use this branch only when the file has real content that this skill did not generate and the user chose (a) Restructure.
Run this branch in order:
./assets/template.md.## Optional review-specific rules.AGENTS.md or CLAUDE.md. Should I move it to the appropriate document and leave a reference here?"./assets/template.md with no existing coverage.# from existing file; new content is labelled # new.Done when: the merged draft is ready for the final editorial pass or any remaining gaps have been routed to Step 7.
Use this branch only when the file has real content that this skill did not generate and the user chose (b) Append.
Run this branch in order:
--- divider and a comment: <!-- Added by accelint-onboard-agents skill -->.Even in append mode, do not add conflicting standing guidance without surfacing the conflict in preview.
Done when: the appended draft is ready for the final editorial pass or any remaining gaps have been routed to Step 7.
Use this branch only when the file has real content that this skill did not generate and the user chose (c) Dry run.
Run this branch in order:
Done when: the dry-run draft is ready for the final editorial pass or any remaining gaps have been routed to Step 7.
Use this branch only when the file matches the skill's expected shape, the user chose to work with the existing file, and the request is one bounded update with a known target section or issue.
Run this branch in order:
Done when: the targeted-refresh draft is ready for the final editorial pass, the work has been escalated to Step 6f, or any remaining required gaps have been routed to Step 7.
Use this branch only when the file matches the skill's expected shape, the user chose to work with the existing file, and targeted refresh is not sufficient.
Run this branch in order:
Extract external findings.
findings: list.findings: section, meaning a bulleted list of factual statements.Run drift detection. Scan the codebase for changes since the file was last updated.
Use the signals below as common examples, not as an exhaustive list.
| Signal | Where to look |
|---|---|
| New packages added | package.json, workspace package.json files |
| CI checks changed | .github/workflows/ — new required gates? |
| Husky hooks modified | .husky/ — new pre-commit steps? |
| New migration directory | migrations/, prisma/migrations/, alembic/ |
| Versioning tooling added | .changeset/, .releaserc* |
| OpenSpec added or removed | openspec/ directory presence |
| New protected branches | .github/branch-protection*, README |
Surface unresolved TODOs.
Find all <!-- TODO: fill in --> markers left from the previous run and surface them as targeted questions.
Merge and announce findings before asking anything. Combine the external findings from Step 6f.1, the drift findings from Step 6f.2, and the TODOs from Step 6f.3.
Present the merged list to the user:
"I found [N] external findings, [M] sections that may have drifted, and [P] unresolved TODOs. I'll only ask about those — the rest looks current."
If external findings exist, note their source, for example "from completed OpenSpec change".
Run the refresh interview, then preview the changed sections first. Only after Step 6f.4 is complete:
If the refresh still leaves unresolved required template fields, go to Step 7.
Otherwise, go to Step 8.
Done when: the changed-section draft is ready for the final editorial pass, with any remaining required gaps routed to Step 7 and the full labeled preview still pending in Step 9.
Run Step 7 only after one Step 6 branch is complete, and only for canonical template sections or required template fields that still have unresolved behavioral gaps. If the selected Step 6 branch already has enough confirmed information, skip Step 7 and go directly to Step 8.
Audit every canonical template section and required template field from ./assets/template.md that still has no answer, including ## Quality bar for finished work, ## Related Documentation, and ## Maintenance guidance where applicable. For each gap, try to derive the behavioral intent directly from the codebase by using parallel subagents before you ask again or leave a <!-- TODO: fill in -->. A behavioral file with explicit TODOs is actionable. A file with missing required template sections silently shapes agent behavior in unpredictable ways.
Discovery fills behavioral gaps. It does not maximize output surface area. Gather broadly when needed, but carry forward only findings that pass the final inclusion rule.
Spawn discovery subagents in parallel. Do not scan serially. Each agent focuses on one behavioral domain and returns structured findings. Wait for all agents to complete. Then merge the results before Step 8.
Spawn these agents at the same time:
Agent A — Version Control & Commit Conventions
commitlint.config.*, recent git log --oneline, .gitmessage, .releaserc*.changeset/, CHANGELOG.md, standard-version, conventional-changelog.github/branch-protection*, README mentions of branch policyAgent B — CI/CD & Pre-commit Workflows
.github/PULL_REQUEST_TEMPLATE.md, .github/workflows/ (CI gate names, required checks).husky/, .lefthook.yml, package.json#scripts (lint, typecheck, test)Agent C — Testing & Code Quality
vitest.config.*, jest.config.*, pytest.ini, pyproject.toml [tool.pytest], Playwright, Cypresspackage-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockbtsconfig.json presence, path aliases in tsconfig.json#paths or vite.configvitest.config.ts — check for clearMocks, mockReset, restoreMocks flagspackage.json scripts — check if tsc --noEmit runs on test filesAgent D — Security & Migrations
migrations/, prisma/migrations/, alembic/.env.example, .gitignore patterns, presence of dotenv or vault toolingAgent E — OpenSpec and spec-driven workflow
openspec/ directory, openspec/config.yml, openspec/config.yaml, and any opsx:* or openspec-* skill referencesAfter all agents complete: merge their findings into a unified discovery map.
Tag each template field as # inferred from [source] or leave it empty if unknown. Fields that remain empty after discovery become explicit <!-- TODO: fill in --> markers in the generated file, and optional template sections should be omitted only when the template explicitly allows removal.
Preview with source annotations:
After you merge discovery results, show a preview with trailing comments on inferred values:
- Always run `pnpm check` before committing # inferred from .husky/pre-commit
- Use Conventional Commits (`feat:`, `fix:`) # inferred from commitlint.config.ts
If a field cannot be inferred — for example decision heuristics, communication style, or role definition — mark it with <!-- TODO: fill in --> rather than omitting the section.
Done when: remaining behavioral gaps are either resolved from repository evidence or left as explicit TODOs before Step 8.
Do not enter Stage 5 until all earlier required steps for the chosen path are complete.
Clean the assembled draft before the user reviews it.
<!-- TODO: fill in --> when confidence is too low.Done when: the draft is cleaned and ready for preview.
Show the full labeled preview of the cleaned AGENTS.md or CLAUDE.md before writing anything.
# from existing file; new content is labelled # new.<!-- TODO: fill in -->../assets/template.md remain present in template order../assets/template.md allows them.This gives the user a complete confidence map.
Ask: "Does this look right? Any sections to correct or expand before I write the file?"
In non-interactive or headless contexts, still produce the full labeled preview and explicitly note that human confirmation could not be collected in-session. Do not claim the file was human-confirmed if it was not.
Do not write the file until this gate is satisfied or the context is explicitly non-interactive.
Done when: the review gate is satisfied, or the context is explicitly non-interactive.
Run this step only for branches that write output. Skip it for Step 6d.
Only after the review gate is satisfied, write to AGENTS.md or CLAUDE.md in the target directory being onboarded, stripping the inference source comments.
Those comments are for review only and must not appear in the final file.
For the ## Related Documentation section, include links only for files that exist in the repository and materially help agent behavior. Check each candidate file before you include its link. Adapt or remove the template's illustrative bullets (ARCHITECTURE.md, CONSTRAINTS.md, openspec/config.yaml, JARGON.md, and any other canonical doc placeholder) based on actual repository files. If openspec/config.yml or openspec/config.yaml are absent, do not include either path.
Done when: the confirmed file is written without review-only comments.
Run this step only after Step 10 writes the file. Skip it for Step 6d.
After the write is complete, evaluate the generated file against ./references/rubric.md.
Use the rubric as a structured post-write review, not as a ceremonial mention. Review the generated AGENTS.md or CLAUDE.md. If the generated file is CLAUDE.md, apply the same rubric to it as the repository's agent-instruction file. Consult same-directory or root-level agent-instruction wrappers and directly linked related docs only when needed to verify scope or references.
Run the review in this order:
(raw score / 5) × category weight.Produce a concise review result for the user that includes:
Use the result to drive the user-facing completion behavior:
AGENTS.md or CLAUDE.md and found the quality to be strong.AGENTS.md or CLAUDE.md and found the quality to be adequate.Do not overstate certainty. If part of the score depends on incomplete repository evidence, say so briefly.
Done when: the user has both the generated file and the post-write quality assessment.
Run this step only after the applicable previous step is complete.
After the write and quality check are complete, print a brief summary of what was generated, what was inferred versus answered directly, which <!-- TODO --> sections still need human input, and the quality-check outcome.
For Step 6d, print the same brief summary except for the write and quality-check outcome, and keep the no-write status explicit.
Done when: the user has the final completion summary.
Read and use the canonical template at: ./assets/template.md
Treat that file as the source of truth for AGENTS.md structure, including exact section names, section order, required-versus-optional sections, placeholder handling, and default scaffolding. When generating, importing, restructuring, appending, auditing, or refreshing AGENTS.md, map all structure-sensitive behavior back to that template rather than to examples, checklists, or embedded section lists in this skill.
When generating or refreshing AGENTS.md, follow the template exactly, fill placeholders from confirmed answers or repository evidence, replace unresolved placeholders with <!-- TODO: fill in -->, keep required template sections, and omit optional sections only when the template explicitly allows it. Keep the final file lean and behavior-focused rather than copying illustrative text verbatim unless it is confirmed or strongly inferred.
Before you consider the onboarding complete, verify that the generated file:
openspec/config.yml, openspec/config.yaml, ARCHITECTURE.md, CONSTRAINTS.md, EPISTEMIC-MAP.md, or JARGON.md./assets/template.md in the template's order, using <!-- TODO: fill in --> where facts remain unknown./references/rubric.md after writing, with the resulting quality note or remediation guidance surfaced to the userpnpm check; can you confirm?" is better than asking from scratch.AGENTS.md or CLAUDE.md and get explicit confirmation before touching the filesystem.AGENTS.md or CLAUDE.md. Route project DNA to openspec/config.yml or openspec/config.yaml with accelint-onboard-openspec, system structure to ARCHITECTURE.md with accelint-architecture-doc, internal terminology to JARGON.md with jargon-extractor, assumptions and risks to EPISTEMIC-MAP.md with epistemic-mapper, and external boundaries to CONSTRAINTS.md with constraints-extractor.AGENTS.md or CLAUDE.md exists, package-level files should reference it and add only what is specific to that package. Repeated instructions across root and package files inflate context on every agent invocation, so keep package files additive, not redundant.