@morozinc/opencode-bmad-plugin 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +31 -0
- package/NOTICE.md +6 -0
- package/README.md +64 -2
- package/dist/gui-experimental.cjs +64 -0
- package/docs/screenshots/artifact-storage.png +0 -0
- package/package.json +53 -4
- package/skills/bmad-code-review/SKILL.md +23 -0
- package/skills/bmad-code-review/reference/SKILL.md +90 -0
- package/skills/bmad-code-review/reference/customize.toml +41 -0
- package/skills/bmad-code-review/reference/steps/step-01-gather-context.md +85 -0
- package/skills/bmad-code-review/reference/steps/step-02-review.md +35 -0
- package/skills/bmad-code-review/reference/steps/step-03-triage.md +49 -0
- package/skills/bmad-code-review/reference/steps/step-04-present.md +132 -0
- package/skills/bmad-create-architecture/SKILL.md +23 -0
- package/skills/bmad-create-architecture/reference/SKILL.md +74 -0
- package/skills/bmad-create-architecture/reference/architecture-decision-template.md +12 -0
- package/skills/bmad-create-architecture/reference/customize.toml +41 -0
- package/skills/bmad-create-architecture/reference/data/domain-complexity.csv +13 -0
- package/skills/bmad-create-architecture/reference/data/project-types.csv +7 -0
- package/skills/bmad-create-architecture/reference/steps/step-01-init.md +153 -0
- package/skills/bmad-create-architecture/reference/steps/step-01b-continue.md +173 -0
- package/skills/bmad-create-architecture/reference/steps/step-02-context.md +224 -0
- package/skills/bmad-create-architecture/reference/steps/step-03-starter.md +329 -0
- package/skills/bmad-create-architecture/reference/steps/step-04-decisions.md +318 -0
- package/skills/bmad-create-architecture/reference/steps/step-05-patterns.md +359 -0
- package/skills/bmad-create-architecture/reference/steps/step-06-structure.md +379 -0
- package/skills/bmad-create-architecture/reference/steps/step-07-validation.md +361 -0
- package/skills/bmad-create-architecture/reference/steps/step-08-complete.md +82 -0
- package/skills/bmad-create-epics-and-stories/SKILL.md +23 -0
- package/skills/bmad-create-epics-and-stories/reference/SKILL.md +93 -0
- package/skills/bmad-create-epics-and-stories/reference/customize.toml +41 -0
- package/skills/bmad-create-epics-and-stories/reference/steps/step-01-validate-prerequisites.md +255 -0
- package/skills/bmad-create-epics-and-stories/reference/steps/step-02-design-epics.md +242 -0
- package/skills/bmad-create-epics-and-stories/reference/steps/step-03-create-stories.md +255 -0
- package/skills/bmad-create-epics-and-stories/reference/steps/step-04-final-validation.md +143 -0
- package/skills/bmad-create-epics-and-stories/reference/templates/epics-template.md +61 -0
- package/skills/bmad-create-story/SKILL.md +23 -0
- package/skills/bmad-create-story/reference/SKILL.md +429 -0
- package/skills/bmad-create-story/reference/checklist.md +357 -0
- package/skills/bmad-create-story/reference/customize.toml +41 -0
- package/skills/bmad-create-story/reference/discover-inputs.md +88 -0
- package/skills/bmad-create-story/reference/template.md +49 -0
- package/skills/bmad-dev-story/SKILL.md +23 -0
- package/skills/bmad-dev-story/reference/SKILL.md +500 -0
- package/skills/bmad-dev-story/reference/checklist.md +80 -0
- package/skills/bmad-dev-story/reference/customize.toml +41 -0
- package/skills/bmad-document-project/SKILL.md +23 -0
- package/skills/bmad-document-project/reference/SKILL.md +62 -0
- package/skills/bmad-document-project/reference/checklist.md +245 -0
- package/skills/bmad-document-project/reference/customize.toml +41 -0
- package/skills/bmad-document-project/reference/documentation-requirements.csv +12 -0
- package/skills/bmad-document-project/reference/instructions.md +128 -0
- package/skills/bmad-document-project/reference/templates/deep-dive-template.md +345 -0
- package/skills/bmad-document-project/reference/templates/index-template.md +169 -0
- package/skills/bmad-document-project/reference/templates/project-overview-template.md +103 -0
- package/skills/bmad-document-project/reference/templates/project-scan-report-schema.json +160 -0
- package/skills/bmad-document-project/reference/templates/source-tree-template.md +135 -0
- package/skills/bmad-document-project/reference/workflows/deep-dive-instructions.md +300 -0
- package/skills/bmad-document-project/reference/workflows/deep-dive-workflow.md +34 -0
- package/skills/bmad-document-project/reference/workflows/full-scan-instructions.md +1108 -0
- package/skills/bmad-document-project/reference/workflows/full-scan-workflow.md +34 -0
- package/skills/bmad-generate-project-context/SKILL.md +23 -0
- package/skills/bmad-generate-project-context/reference/SKILL.md +81 -0
- package/skills/bmad-generate-project-context/reference/customize.toml +41 -0
- package/skills/bmad-generate-project-context/reference/project-context-template.md +21 -0
- package/skills/bmad-generate-project-context/reference/steps/step-01-discover.md +186 -0
- package/skills/bmad-generate-project-context/reference/steps/step-02-generate.md +321 -0
- package/skills/bmad-generate-project-context/reference/steps/step-03-complete.md +284 -0
- package/skills/bmad-help/SKILL.md +19 -0
- package/skills/bmad-help/reference/SKILL.md +75 -0
- package/skills/bmad-prd/SKILL.md +23 -0
- package/skills/bmad-prd/reference/SKILL.md +92 -0
- package/skills/bmad-prd/reference/assets/headless-schemas.md +76 -0
- package/skills/bmad-prd/reference/assets/prd-template.md +165 -0
- package/skills/bmad-prd/reference/assets/prd-validation-checklist.md +135 -0
- package/skills/bmad-prd/reference/assets/validation-report-template.html +325 -0
- package/skills/bmad-prd/reference/customize.toml +147 -0
- package/skills/bmad-prd/reference/references/headless.md +39 -0
- package/skills/bmad-prd/reference/references/validate.md +97 -0
- package/skills/bmad-product-brief/SKILL.md +22 -0
- package/skills/bmad-product-brief/reference/SKILL.md +91 -0
- package/skills/bmad-product-brief/reference/assets/brief-template.md +41 -0
- package/skills/bmad-product-brief/reference/customize.toml +99 -0
- package/skills/bmad-quick-dev/SKILL.md +26 -0
- package/skills/bmad-quick-dev/reference/SKILL.md +111 -0
- package/skills/bmad-quick-dev/reference/compile-epic-context.md +62 -0
- package/skills/bmad-quick-dev/reference/customize.toml +41 -0
- package/skills/bmad-quick-dev/reference/spec-template.md +88 -0
- package/skills/bmad-quick-dev/reference/step-01-clarify-and-route.md +100 -0
- package/skills/bmad-quick-dev/reference/step-02-plan.md +47 -0
- package/skills/bmad-quick-dev/reference/step-03-implement.md +41 -0
- package/skills/bmad-quick-dev/reference/step-04-review.md +50 -0
- package/skills/bmad-quick-dev/reference/step-05-present.md +78 -0
- package/skills/bmad-quick-dev/reference/step-oneshot.md +71 -0
- package/skills/bmad-quick-dev/reference/sync-sprint-status.md +19 -0
- package/skills/bmad-sprint-planning/SKILL.md +23 -0
- package/skills/bmad-sprint-planning/reference/SKILL.md +300 -0
- package/skills/bmad-sprint-planning/reference/checklist.md +33 -0
- package/skills/bmad-sprint-planning/reference/customize.toml +41 -0
- package/skills/bmad-sprint-planning/reference/sprint-status-template.yaml +56 -0
- package/src/gui.tsx +127 -0
- package/src/index.ts +114 -0
- package/src/rpc.ts +27 -0
- package/src/storage.ts +21 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Full Project Scan Sub-Workflow
|
|
2
|
+
|
|
3
|
+
**Goal:** Complete project documentation (initial scan or full rescan).
|
|
4
|
+
|
|
5
|
+
**Your Role:** Full project scan documentation specialist.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## INITIALIZATION
|
|
10
|
+
|
|
11
|
+
### Configuration Loading
|
|
12
|
+
|
|
13
|
+
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
|
|
14
|
+
|
|
15
|
+
- `project_knowledge`
|
|
16
|
+
- `user_name`
|
|
17
|
+
- `communication_language`, `document_output_language`
|
|
18
|
+
- `date` as system-generated current datetime
|
|
19
|
+
|
|
20
|
+
✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the configured `{communication_language}`.
|
|
21
|
+
✅ YOU MUST ALWAYS WRITE all artifact and document content in `{document_output_language}`.
|
|
22
|
+
|
|
23
|
+
### Runtime Inputs
|
|
24
|
+
|
|
25
|
+
- `workflow_mode` = `""` (set by parent: `initial_scan` or `full_rescan`)
|
|
26
|
+
- `scan_level` = `""` (set by parent: `quick`, `deep`, or `exhaustive`)
|
|
27
|
+
- `resume_mode` = `false`
|
|
28
|
+
- `autonomous` = `false` (requires user input at key decision points)
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## EXECUTION
|
|
33
|
+
|
|
34
|
+
Read fully and follow: `./full-scan-instructions.md`
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bmad-generate-project-context
|
|
3
|
+
description: 'Create project-context.md with AI rules. Use when the user says "generate project context" or "create project context"'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# bmad-generate-project-context · OpenCode edition
|
|
7
|
+
|
|
8
|
+
## Artifact storage
|
|
9
|
+
|
|
10
|
+
Use the **BMAD artifact storage** contract injected by the OpenCode BMAD plugin for this project. It names the selected backend, project root and exact artifact prefix. Call `bmad_storage` if the contract is missing or you need to refresh it. Read existing artifacts before editing, write complete Markdown, then read back and verify. Keep each artifact's logical name stable. Do not switch storage backends silently. The plugin is installed globally; project artifacts are scoped to the current repository. Source code changes remain in the repository. Bundled references may mention upstream project-local `_bmad` setup, config or scripts; use their methodology without requiring those files in the project. The selected storage contract overrides artifact paths in references.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
1. Read existing project guidance from artifact storage and inspect the code/configuration that establishes conventions. Retrieve relevant reusable rules.
|
|
15
|
+
2. Produce concise, actionable guidance for future agents: stack, code boundaries, style, important invariants, tests, commands and mistakes to avoid. Include only verified rules that affect decisions.
|
|
16
|
+
3. Deduplicate with existing guidance and remove superseded rules in place. Separate mandatory project constraints from preferences and provide evidence paths.
|
|
17
|
+
4. Save and verify `project-context.md` in the selected artifact storage. Do not modify AGENTS.md or CLAUDE.md as a side effect.
|
|
18
|
+
|
|
19
|
+
**Primary artifact:** `project-context.md`. Use a stable descriptive `<story-id>`, `<review-id>` or `<change-id>` where shown, and return its full verified artifact path.
|
|
20
|
+
|
|
21
|
+
## Optional method references
|
|
22
|
+
|
|
23
|
+
Read only the template or checklist needed for the current step, relative to this skill directory: `reference/project-context-template.md`. The references preserve upstream methodology; their filesystem writes, activation scripts and local artifact discovery are replaced by the BMAD artifact storage contract above. Do not load the entire upstream workflow or unrelated artifacts.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bmad-generate-project-context
|
|
3
|
+
description: 'Create project-context.md with AI rules. Use when the user says "generate project context" or "create project context"'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Generate Project Context Workflow
|
|
7
|
+
|
|
8
|
+
**Goal:** Create a concise, optimized `project-context.md` file containing critical rules, patterns, and guidelines that AI agents must follow when implementing code. This file focuses on unobvious details that LLMs need to be reminded of.
|
|
9
|
+
|
|
10
|
+
**Your Role:** You are a technical facilitator working with a peer to capture the essential implementation rules that will ensure consistent, high-quality code generation across all AI agents working on the project.
|
|
11
|
+
|
|
12
|
+
## Conventions
|
|
13
|
+
|
|
14
|
+
- Bare paths (e.g. `steps/step-01-discover.md`) resolve from the skill root.
|
|
15
|
+
- `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives).
|
|
16
|
+
- `{project-root}`-prefixed paths resolve from the project working directory.
|
|
17
|
+
- `{skill-name}` resolves to the skill directory's basename.
|
|
18
|
+
|
|
19
|
+
## WORKFLOW ARCHITECTURE
|
|
20
|
+
|
|
21
|
+
This uses **micro-file architecture** for disciplined execution:
|
|
22
|
+
|
|
23
|
+
- Each step is a self-contained file with embedded rules
|
|
24
|
+
- Sequential progression with user control at each step
|
|
25
|
+
- Document state tracked in frontmatter
|
|
26
|
+
- Focus on lean, LLM-optimized content generation
|
|
27
|
+
- You NEVER proceed to a step file if the current step file indicates the user must approve and indicate continuation.
|
|
28
|
+
|
|
29
|
+
## On Activation
|
|
30
|
+
|
|
31
|
+
### Step 1: Resolve the Workflow Block
|
|
32
|
+
|
|
33
|
+
Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`
|
|
34
|
+
|
|
35
|
+
**If the script fails**, resolve the `workflow` block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
|
|
36
|
+
|
|
37
|
+
1. `{skill-root}/customize.toml` — defaults
|
|
38
|
+
2. `{project-root}/_bmad/custom/{skill-name}.toml` — team overrides
|
|
39
|
+
3. `{project-root}/_bmad/custom/{skill-name}.user.toml` — personal overrides
|
|
40
|
+
|
|
41
|
+
Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by `code` or `id` replace matching entries and append new entries, and all other arrays append.
|
|
42
|
+
|
|
43
|
+
### Step 2: Execute Prepend Steps
|
|
44
|
+
|
|
45
|
+
Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding.
|
|
46
|
+
|
|
47
|
+
### Step 3: Load Persistent Facts
|
|
48
|
+
|
|
49
|
+
Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. Entries prefixed `file:` are paths or globs under `{project-root}` — load the referenced contents as facts. All other entries are facts verbatim.
|
|
50
|
+
|
|
51
|
+
### Step 4: Load Config
|
|
52
|
+
|
|
53
|
+
Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
|
|
54
|
+
- Use `{user_name}` for greeting
|
|
55
|
+
- Use `{communication_language}` for all communications
|
|
56
|
+
- Use `{document_output_language}` for output documents
|
|
57
|
+
- Use `{planning_artifacts}` for output location and artifact scanning
|
|
58
|
+
- Use `{project_knowledge}` for additional context scanning
|
|
59
|
+
|
|
60
|
+
### Step 5: Greet the User
|
|
61
|
+
|
|
62
|
+
Greet `{user_name}`, speaking in `{communication_language}`.
|
|
63
|
+
|
|
64
|
+
### Step 6: Execute Append Steps
|
|
65
|
+
|
|
66
|
+
Execute each entry in `{workflow.activation_steps_append}` in order.
|
|
67
|
+
|
|
68
|
+
Activation is complete. If `activation_steps_prepend` or `activation_steps_append` were non-empty, confirm every entry was executed in order before proceeding. Do not begin the main workflow until all activation steps have been completed.
|
|
69
|
+
|
|
70
|
+
## Paths
|
|
71
|
+
|
|
72
|
+
- `output_file` = `{output_folder}/project-context.md`
|
|
73
|
+
|
|
74
|
+
## Execution
|
|
75
|
+
|
|
76
|
+
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
|
|
77
|
+
- ✅ YOU MUST ALWAYS WRITE all artifact and document content in `{document_output_language}`
|
|
78
|
+
|
|
79
|
+
Load and execute `./steps/step-01-discover.md` to begin the workflow.
|
|
80
|
+
|
|
81
|
+
**Note:** Input document discovery and initialization protocols are handled in step-01-discover.md.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# DO NOT EDIT -- overwritten on every update.
|
|
2
|
+
#
|
|
3
|
+
# Workflow customization surface for bmad-generate-project-context. Mirrors the
|
|
4
|
+
# agent customization shape under the [workflow] namespace.
|
|
5
|
+
|
|
6
|
+
[workflow]
|
|
7
|
+
|
|
8
|
+
# --- Configurable below. Overrides merge per BMad structural rules: ---
|
|
9
|
+
# scalars: override wins • arrays (persistent_facts, activation_steps_*): append
|
|
10
|
+
# arrays-of-tables with `code`/`id`: replace matching items, append new ones.
|
|
11
|
+
|
|
12
|
+
# Steps to run before the standard activation (config load, greet).
|
|
13
|
+
# Overrides append. Use for pre-flight loads, compliance checks, etc.
|
|
14
|
+
|
|
15
|
+
activation_steps_prepend = []
|
|
16
|
+
|
|
17
|
+
# Steps to run after greet but before the workflow begins.
|
|
18
|
+
# Overrides append. Use for context-heavy setup that should happen
|
|
19
|
+
# once the user has been acknowledged.
|
|
20
|
+
|
|
21
|
+
activation_steps_append = []
|
|
22
|
+
|
|
23
|
+
# Persistent facts the workflow keeps in mind for the whole run
|
|
24
|
+
# (standards, compliance constraints, stylistic guardrails).
|
|
25
|
+
# Distinct from the runtime memory sidecar — these are static context
|
|
26
|
+
# loaded on activation. Overrides append.
|
|
27
|
+
#
|
|
28
|
+
# Each entry is either:
|
|
29
|
+
# - a literal sentence, e.g. "All artifacts must follow org naming conventions."
|
|
30
|
+
# - a file reference prefixed with `file:`, e.g. "file:{project-root}/docs/standards.md"
|
|
31
|
+
# (glob patterns are supported; the file's contents are loaded and treated as facts).
|
|
32
|
+
|
|
33
|
+
persistent_facts = [
|
|
34
|
+
"file:{project-root}/**/project-context.md",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
# Scalar: executed when the workflow reaches Step 3 (Context Completion & Finalization),
|
|
38
|
+
# after the project-context.md file is optimized and saved. Override wins.
|
|
39
|
+
# Leave empty for no custom post-completion behavior.
|
|
40
|
+
|
|
41
|
+
on_complete = ""
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
project_name: '{{project_name}}'
|
|
3
|
+
user_name: '{{user_name}}'
|
|
4
|
+
date: '{{date}}'
|
|
5
|
+
sections_completed: ['technology_stack']
|
|
6
|
+
existing_patterns_found: { { number_of_patterns_discovered } }
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Project Context for AI Agents
|
|
10
|
+
|
|
11
|
+
_This file contains critical rules and patterns that AI agents must follow when implementing code in this project. Focus on unobvious details that agents might otherwise miss._
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Technology Stack & Versions
|
|
16
|
+
|
|
17
|
+
_Documented after discovery phase_
|
|
18
|
+
|
|
19
|
+
## Critical Implementation Rules
|
|
20
|
+
|
|
21
|
+
_Documented after discovery phase_
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Step 1: Context Discovery & Initialization
|
|
2
|
+
|
|
3
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
4
|
+
|
|
5
|
+
- 🛑 NEVER generate content without user input
|
|
6
|
+
- ✅ ALWAYS treat this as collaborative discovery between technical peers
|
|
7
|
+
- 📋 YOU ARE A FACILITATOR, not a content generator
|
|
8
|
+
- 💬 FOCUS on discovering existing project context and technology stack
|
|
9
|
+
- 🎯 IDENTIFY critical implementation rules that AI agents need
|
|
10
|
+
- ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
|
|
11
|
+
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
|
|
12
|
+
|
|
13
|
+
## EXECUTION PROTOCOLS:
|
|
14
|
+
|
|
15
|
+
- 🎯 Show your analysis before taking any action
|
|
16
|
+
- 📖 Read existing project files to understand current context
|
|
17
|
+
- 💾 Initialize document and update frontmatter
|
|
18
|
+
- 🚫 FORBIDDEN to load next step until discovery is complete
|
|
19
|
+
|
|
20
|
+
## CONTEXT BOUNDARIES:
|
|
21
|
+
|
|
22
|
+
- Variables from workflow.md are available in memory
|
|
23
|
+
- Focus on existing project files and architecture decisions
|
|
24
|
+
- Look for patterns, conventions, and unique requirements
|
|
25
|
+
- Prioritize rules that prevent implementation mistakes
|
|
26
|
+
|
|
27
|
+
## YOUR TASK:
|
|
28
|
+
|
|
29
|
+
Discover the project's technology stack, existing patterns, and critical implementation rules that AI agents must follow when writing code.
|
|
30
|
+
|
|
31
|
+
## DISCOVERY SEQUENCE:
|
|
32
|
+
|
|
33
|
+
### 1. Check for Existing Project Context
|
|
34
|
+
|
|
35
|
+
First, check if project context already exists:
|
|
36
|
+
|
|
37
|
+
- Look for file at `{project_knowledge}/project-context.md or {project-root}/**/project-context.md`
|
|
38
|
+
- If exists: Read complete file to understand existing rules
|
|
39
|
+
- Present to user: "Found existing project context with {number_of_sections} sections. Would you like to update this or create a new one?"
|
|
40
|
+
|
|
41
|
+
### 2. Discover Project Technology Stack
|
|
42
|
+
|
|
43
|
+
Load and analyze project files to identify technologies:
|
|
44
|
+
|
|
45
|
+
**Architecture Document:**
|
|
46
|
+
|
|
47
|
+
- Look for `{planning_artifacts}/architecture.md`
|
|
48
|
+
- Extract technology choices with specific versions
|
|
49
|
+
- Note architectural decisions that affect implementation
|
|
50
|
+
|
|
51
|
+
**Package Files:**
|
|
52
|
+
|
|
53
|
+
- Check for `package.json`, `requirements.txt`, `Cargo.toml`, etc.
|
|
54
|
+
- Extract exact versions of all dependencies
|
|
55
|
+
- Note development vs production dependencies
|
|
56
|
+
|
|
57
|
+
**Configuration Files:**
|
|
58
|
+
|
|
59
|
+
- Look for project language specific configs ( example: `tsconfig.json`)
|
|
60
|
+
- Build tool configs (webpack, vite, next.config.js, etc.)
|
|
61
|
+
- Linting and formatting configs (.eslintrc, .prettierrc, etc.)
|
|
62
|
+
- Testing configurations (jest.config.js, vitest.config.ts, etc.)
|
|
63
|
+
|
|
64
|
+
### 3. Identify Existing Code Patterns
|
|
65
|
+
|
|
66
|
+
Search through existing codebase for patterns:
|
|
67
|
+
|
|
68
|
+
**Naming Conventions:**
|
|
69
|
+
|
|
70
|
+
- File naming patterns (PascalCase, kebab-case, etc.)
|
|
71
|
+
- Component/function naming conventions
|
|
72
|
+
- Variable naming patterns
|
|
73
|
+
- Test file naming patterns
|
|
74
|
+
|
|
75
|
+
**Code Organization:**
|
|
76
|
+
|
|
77
|
+
- How components are structured
|
|
78
|
+
- Where utilities and helpers are placed
|
|
79
|
+
- How services are organized
|
|
80
|
+
- Test organization patterns
|
|
81
|
+
|
|
82
|
+
**Documentation Patterns:**
|
|
83
|
+
|
|
84
|
+
- Comment styles and conventions
|
|
85
|
+
- Documentation requirements
|
|
86
|
+
- README and API doc patterns
|
|
87
|
+
|
|
88
|
+
### 4. Extract Critical Implementation Rules
|
|
89
|
+
|
|
90
|
+
Look for rules that AI agents might miss:
|
|
91
|
+
|
|
92
|
+
**Language-Specific Rules:**
|
|
93
|
+
|
|
94
|
+
- TypeScript strict mode requirements
|
|
95
|
+
- Import/export conventions
|
|
96
|
+
- Async/await vs Promise usage patterns
|
|
97
|
+
- Error handling patterns specific to the language
|
|
98
|
+
|
|
99
|
+
**Framework-Specific Rules:**
|
|
100
|
+
|
|
101
|
+
- React hooks usage patterns
|
|
102
|
+
- API route conventions
|
|
103
|
+
- Middleware usage patterns
|
|
104
|
+
- State management patterns
|
|
105
|
+
|
|
106
|
+
**Testing Rules:**
|
|
107
|
+
|
|
108
|
+
- Test structure requirements
|
|
109
|
+
- Mock usage conventions
|
|
110
|
+
- Integration vs unit test boundaries
|
|
111
|
+
- Coverage requirements
|
|
112
|
+
|
|
113
|
+
**Development Workflow Rules:**
|
|
114
|
+
|
|
115
|
+
- Branch naming conventions
|
|
116
|
+
- Commit message patterns
|
|
117
|
+
- PR review requirements
|
|
118
|
+
- Deployment procedures
|
|
119
|
+
|
|
120
|
+
### 5. Initialize Project Context Document
|
|
121
|
+
|
|
122
|
+
Based on discovery, create or update the context document:
|
|
123
|
+
|
|
124
|
+
#### A. Fresh Document Setup (if no existing context)
|
|
125
|
+
|
|
126
|
+
Copy template from `../project-context-template.md` to `{output_folder}/project-context.md`
|
|
127
|
+
Initialize frontmatter fields.
|
|
128
|
+
|
|
129
|
+
#### B. Existing Document Update
|
|
130
|
+
|
|
131
|
+
Load existing context and prepare for updates
|
|
132
|
+
Set frontmatter `sections_completed` to track what will be updated
|
|
133
|
+
|
|
134
|
+
### 6. Present Discovery Summary
|
|
135
|
+
|
|
136
|
+
Report findings to user:
|
|
137
|
+
|
|
138
|
+
"Welcome {{user_name}}! I've analyzed your project for {{project_name}} to discover the context that AI agents need.
|
|
139
|
+
|
|
140
|
+
**Technology Stack Discovered:**
|
|
141
|
+
{{list_of_technologies_with_versions}}
|
|
142
|
+
|
|
143
|
+
**Existing Patterns Found:**
|
|
144
|
+
|
|
145
|
+
- {{number_of_patterns}} implementation patterns
|
|
146
|
+
- {{number_of_conventions}} coding conventions
|
|
147
|
+
- {{number_of_rules}} critical rules
|
|
148
|
+
|
|
149
|
+
**Key Areas for Context Rules:**
|
|
150
|
+
|
|
151
|
+
- {{area_1}} (e.g., TypeScript configuration)
|
|
152
|
+
- {{area_2}} (e.g., Testing patterns)
|
|
153
|
+
- {{area_3}} (e.g., Code organization)
|
|
154
|
+
|
|
155
|
+
{if_existing_context}
|
|
156
|
+
**Existing Context:** Found {{sections}} sections already defined. We can update or add to these.
|
|
157
|
+
{/if_existing_context}
|
|
158
|
+
|
|
159
|
+
Ready to create/update your project context. This will help AI agents implement code consistently with your project's standards.
|
|
160
|
+
|
|
161
|
+
[C] Continue to context generation"
|
|
162
|
+
|
|
163
|
+
**HALT — wait for user selection before proceeding.**
|
|
164
|
+
|
|
165
|
+
## SUCCESS METRICS:
|
|
166
|
+
|
|
167
|
+
✅ Existing project context properly detected and handled
|
|
168
|
+
✅ Technology stack accurately identified with versions
|
|
169
|
+
✅ Critical implementation patterns discovered
|
|
170
|
+
✅ Project context document properly initialized
|
|
171
|
+
✅ Discovery findings clearly presented to user
|
|
172
|
+
✅ User ready to proceed with context generation
|
|
173
|
+
|
|
174
|
+
## FAILURE MODES:
|
|
175
|
+
|
|
176
|
+
❌ Not checking for existing project context before creating new one
|
|
177
|
+
❌ Missing critical technology versions or configurations
|
|
178
|
+
❌ Overlooking important coding patterns or conventions
|
|
179
|
+
❌ Not initializing frontmatter properly
|
|
180
|
+
❌ Not presenting clear discovery summary to user
|
|
181
|
+
|
|
182
|
+
## NEXT STEP:
|
|
183
|
+
|
|
184
|
+
After user selects [C] to continue, load `./step-02-generate.md` to collaboratively generate the specific project context rules.
|
|
185
|
+
|
|
186
|
+
Remember: Do NOT proceed to step-02 until user explicitly selects [C] from the menu and discovery is confirmed and the initial file has been written as directed in this discovery step!
|