Skip to content

Commit 395e9b6

Browse files
docs(prompts): remove fork-info.json dependency, use git remote detection instead
- Update /specify, /plan, /tasks, and /implement prompts to detect fork mode via git remote -v - Remove all references to .fork-info.json configuration file - Simplify fork contribution workflow with automatic detection - Add comprehensive linter configuration documentation to README
1 parent 08d2dd6 commit 395e9b6

File tree

5 files changed

+83
-99
lines changed

5 files changed

+83
-99
lines changed

.github/prompts/implement.prompt.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $ARGUMENTS
1515
**Workflow Modes**: This command supports two modes:
1616

1717
- **Local (default)**: Work with the current repository (origin). No special configuration needed.
18-
- **Fork**: Contribute to an upstream repository. Reads `.fork-info.json` created by `/specify`.
18+
- **Fork**: Contribute to an upstream repository. Detected via `git remote -v`.
1919

2020
**Iteration Support**: This command supports iterative implementation — you can run it multiple times to complete remaining tasks, fix issues, or add refinements. Task completion state is tracked in `tasks.md` with `[X]` markers.
2121

@@ -25,11 +25,14 @@ $ARGUMENTS
2525

2626
1. **Set Implementing label immediately**
2727
- **Determine target repository**:
28-
- Check if `.fork-info.json` exists in the feature directory.
29-
- If it exists:
30-
- Validate required fields: `is_fork` (true), `upstream_owner` (non-empty), `upstream_repo` (non-empty).
31-
- Use `upstream_owner/upstream_repo` for all GitHub operations.
32-
- If it doesn't exist, use the current repository (origin).
28+
- Run `git remote -v` to check configured remotes
29+
- **If `upstream` remote exists**: Fork mode
30+
- Parse the upstream URL to extract owner and repo name
31+
- Example: `upstream https://github.com/PSModule/Utilities.git` → owner: `PSModule`, repo: `Utilities`
32+
- Use `upstream_owner/upstream_repo` for all GitHub operations
33+
- **If only `origin` remote exists**: Origin mode
34+
- Parse the origin URL to extract owner and repo name
35+
- Use `origin_owner/origin_repo` for all GitHub operations
3336
- Get the issue number associated with the current feature branch.
3437
- **Add `Implementing` label** to the issue and PR immediately in the target repository.
3538
- **Remove `Planning` label** from the issue and PR.
@@ -158,7 +161,6 @@ $ARGUMENTS
158161

159162
* Remove `Implementing` label.
160163
* Ensure PR is not draft.
161-
* Sync `.fork-info.json` with issue + PR numbers.
162164

163165
**Fallback commands:**
164166

.github/prompts/plan.prompt.md

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,22 @@ $ARGUMENTS
1212

1313
**Workflow Modes**: This command supports two modes:
1414
- **Local (default)**: Work with the current repository (origin). No special configuration needed.
15-
- **Fork**: Contribute to an upstream repository. Reads `.fork-info.json` created by `/specify`.
15+
- **Fork**: Contribute to an upstream repository. Detected via `git remote -v`.
1616

1717
**Iteration Support**: This command detects whether you're creating a new plan or updating an existing one based on the presence of plan.md in the feature directory.
1818

1919
Given the implementation details provided as an argument, do this:
2020

2121
1. **Set Planning label immediately**:
2222
- **Determine target repository**:
23-
- Check if `.fork-info.json` exists in the feature directory
24-
- If it exists:
25-
- Validate required fields: `is_fork` (true), `upstream_owner` (non-empty), `upstream_repo` (non-empty)
23+
- Run `git remote -v` to check configured remotes
24+
- **If `upstream` remote exists**: Fork mode
25+
- Parse the upstream URL to extract owner and repo name
26+
- Example: `upstream https://github.com/PSModule/Utilities.git` → owner: `PSModule`, repo: `Utilities`
2627
- Use `upstream_owner/upstream_repo` for all GitHub operations
27-
- If it doesn't exist, use the current repository (origin)
28+
- **If only `origin` remote exists**: Origin mode
29+
- Parse the origin URL to extract owner and repo name
30+
- Use `origin_owner/origin_repo` for all GitHub operations
2831
- Get the issue number associated with the current feature branch
2932
- **Add 'Planning' label** to the issue immediately in the target repository
3033
- **Remove 'Specification' label** from the issue
@@ -82,13 +85,14 @@ Given the implementation details provided as an argument, do this:
8285

8386
8. Create or update a Pull Request:
8487
- **Determine workflow mode and target repository**:
85-
- Check if `.fork-info.json` exists in the feature directory (same directory as spec.md)
86-
- **If exists** (fork mode):
87-
- Validate required fields: `is_fork` (true), `upstream_owner` (non-empty), `upstream_repo` (non-empty)
88-
- If validation fails, halt and instruct user: "Invalid fork configuration in `.fork-info.json`. Please run `/specify` again with complete fork information: upstream owner, upstream repo."
88+
- Run `git remote -v` to check configured remotes
89+
- **If `upstream` remote exists** (fork mode):
90+
- Parse the upstream URL to extract owner and repo name
91+
- Example: `upstream https://github.com/PSModule/Utilities.git` → owner: `PSModule`, repo: `Utilities`
8992
- Use `upstream_owner/upstream_repo` for all GitHub operations
90-
- **If not exists** (local mode - default):
91-
- Use the current repository (origin) for all GitHub operations
93+
- **If only `origin` remote exists** (local mode - default):
94+
- Parse the origin URL to extract owner and repo name
95+
- Use `origin_owner/origin_repo` for all GitHub operations
9296
- **Determine PR operation** (create vs update):
9397
- If PR already exists for this branch, UPDATE it
9498
- If no PR exists, CREATE a new one
@@ -119,18 +123,6 @@ Given the implementation details provided as an argument, do this:
119123
* **Version/change level label**: Based on the type of change: `Major`, `Minor`, `Patch`, `Fix`, or `Docs`
120124
* **Phase label**: `Planning` (to indicate current phase)
121125
- Link the PR to the associated issue
122-
- **After PR creation**: Update `.fork-info.json` (if it exists) with the PR number:
123-
```json
124-
{
125-
"is_fork": true,
126-
"upstream_owner": "...",
127-
"upstream_repo": "...",
128-
"detected_from": "user_input",
129-
"created_at": "...",
130-
"issue_number": <issue-number>,
131-
"pr_number": <pr-number>
132-
}
133-
```
134126

135127
**GitHub Integration**: If GitHub tools or integrations are available (such as GitHub MCP Server or other GitHub integrations), use them to create/update the PR and manage labels automatically in the target repository. If not available, provide these fallback commands with the correct repository:
136128
```bash

.github/prompts/specify.prompt.md

Lines changed: 19 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,23 @@ $ARGUMENTS
1212

1313
**Workflow Modes**: This command supports two modes:
1414
- **Local (default)**: Work with the current repository (origin). No special configuration needed.
15-
- **Fork**: Contribute to an upstream repository. Requires explicit declaration with upstream owner/repo information.
15+
- **Fork**: Contribute to an upstream repository. Automatically detected via `git remote -v`.
1616

1717
**Iteration Support**: This command detects whether you're creating a new feature or refining an existing one based on your current branch.
1818

1919
The text the user typed after `/specify` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `$ARGUMENTS` appears literally below. Do not ask the user to repeat it unless they provided an empty command.
2020

2121
Given that feature description, do this:
2222

23-
1. **Check for fork contribution**: Analyze the user input for mentions of contributing to a fork or upstream repository. Look for phrases like:
24-
- "fork contribution"
25-
- "contributing to upstream"
26-
- "fork of [owner/repo]"
27-
- "upstream repo [owner/repo]"
28-
- Any explicit mention of working on a fork
29-
30-
If detected, extract the upstream repository information (owner/repo).
31-
32-
**If fork contribution is detected but information is incomplete**, prompt the user:
33-
34-
```text
35-
Fork contribution detected. Please provide the following information:
36-
- Upstream organization/owner name (e.g., "microsoft", "PSModule")
37-
- Upstream repository name (e.g., "vscode", "PSModule")
38-
- Git remote name for upstream (optional, defaults to "upstream")
39-
40-
Example: "upstream owner: PSModule, upstream repo: Utilities"
41-
```
42-
43-
Wait for user response and re-parse the input before proceeding. Required fields:
44-
- `upstream_owner` (string, non-empty)
45-
- `upstream_repo` (string, non-empty)
46-
- `upstream_remote` (string, optional, defaults to "upstream")
23+
1. **Detect repository mode**:
24+
- Run `git remote -v` to check configured remotes
25+
- **If `upstream` remote exists**: Fork mode detected
26+
- Parse the upstream URL to extract owner and repo name
27+
- Example: `upstream https://github.com/PSModule/Utilities.git` → owner: `PSModule`, repo: `Utilities`
28+
- Inform user: "Fork contribution detected. Issues and PRs will target `<upstream_owner>/<upstream_repo>`"
29+
- **If only `origin` remote exists**: Origin mode (default)
30+
- Parse the origin URL to extract owner and repo name
31+
- Use `origin_owner/origin_repo` for all GitHub operations
4732

4833
2. Analyze the feature description and generate a concise, descriptive branch name:
4934
- Extract the core concept/action from the description (2-4 words maximum)
@@ -62,29 +47,9 @@ Given that feature description, do this:
6247
- If you're already on a feature branch (starts with 3 digits like `001-`, `002-`, etc.), you'll stay on that branch to iterate on the existing feature.
6348
- This allows you to refine specifications without creating multiple branches for the same feature.
6449

65-
4. **Store fork information (if detected in step 1)**:
66-
- If the user indicated this is a fork contribution, create a `.fork-info.json` file in the feature directory (same location as SPEC_FILE)
67-
- **Validate required fields before creating**:
68-
- `upstream_owner` must be non-empty string
69-
- `upstream_repo` must be non-empty string
70-
- If validation fails, return to step 1 for clarification
71-
- The file should contain:
72-
```json
73-
{
74-
"is_fork": true,
75-
"upstream_owner": "<extracted-owner>",
76-
"upstream_repo": "<extracted-repo>",
77-
"upstream_remote": "<extracted-remote-or-upstream>",
78-
"detected_from": "user_input",
79-
"created_at": "<ISO8601-timestamp>"
80-
}
81-
```
82-
- This file will be used by `/plan` and `/implement` commands to create issues and PRs in the correct repository
83-
- If fork information was detected, inform the user: "Fork contribution detected. Issues and PRs will target `<upstream_owner>/<upstream_repo>`"
84-
85-
5. Load [`.specify/templates/spec-template.md`](../../.specify/templates/spec-template.md) to understand required sections.
86-
87-
6. **Write or update the specification**:
50+
4. Load [`.specify/templates/spec-template.md`](../../.specify/templates/spec-template.md) to understand required sections.
51+
52+
5. **Write or update the specification**:
8853
- **If IS_EXISTING_BRANCH is false** (new feature on main branch):
8954
- Write a new specification to SPEC_FILE using the template structure
9055
- Replace placeholders with concrete details derived from the feature description
@@ -102,14 +67,10 @@ Given that feature description, do this:
10267
- Maintain the template structure and section order
10368
- The goal is evolution, not replacement - build upon the existing spec rather than starting over
10469

105-
7. Create or update a GitHub issue for this feature:
106-
- **Determine target repository**:
107-
- Check if `.fork-info.json` exists in the feature directory
108-
- If it exists:
109-
- Validate required fields: `is_fork` (true), `upstream_owner` (non-empty), `upstream_repo` (non-empty)
110-
- If validation fails, prompt user for correct information (see step 1)
111-
- Use `upstream_owner/upstream_repo` for all GitHub operations
112-
- If it doesn't exist, use the current repository (origin)
70+
6. Create or update a GitHub issue for this feature:
71+
- **Use target repository determined in step 1**:
72+
- If fork mode: Use `upstream_owner/upstream_repo` for all GitHub operations
73+
- If origin mode: Use `origin_owner/origin_repo` for all GitHub operations
11374
- **Generate the issue title** in format `<Icon> [Type]: <Feature name>` where:
11475
- Icon: 📖 (Docs), 🪲 (Fix), ⚠️ (Security fix), 🩹 (Patch), 🚀 (Feature/Minor), 🌟 (Breaking change/Major)
11576
- Type: Docs, Fix, Patch, Feature, or Breaking change
@@ -142,8 +103,8 @@ Given that feature description, do this:
142103
gh issue edit <issue-number> --body-file <SPEC_FILE>
143104
```
144105

145-
8. **Post final status comment**: "✅ Specification complete. Ready for clarification with `/clarify` or planning with `/plan`."
106+
7. **Post final status comment**: "✅ Specification complete. Ready for clarification with `/clarify` or planning with `/plan`."
146107

147-
9. Report completion with branch name, spec file path, whether it's a new or updated feature, issue number, target repository (if fork), and readiness for the next phase.
108+
8. Report completion with branch name, spec file path, whether it's a new or updated feature, issue number, target repository (if fork), and readiness for the next phase.
148109

149110
Note: The script handles branch creation/reuse and initializes the spec file before writing.

.github/prompts/tasks.prompt.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $ARGUMENTS
1212

1313
**Workflow Modes**: This command supports two modes:
1414
- **Local (default)**: Work with the current repository (origin). No special configuration needed.
15-
- **Fork**: Contribute to an upstream repository. Reads `.fork-info.json` created by `/specify`.
15+
- **Fork**: Contribute to an upstream repository. Detected via `git remote -v`.
1616

1717
**Iteration Support**: This command detects whether you're creating new tasks or updating existing ones based on the presence of tasks.md in the feature directory.
1818

@@ -83,13 +83,14 @@ $ARGUMENTS
8383

8484
8. Update the Pull Request description:
8585
- **Determine workflow mode and target repository**:
86-
- Check if `.fork-info.json` exists in the feature directory (same location as plan.md)
87-
- **If exists** (fork mode):
88-
- Validate required fields: `is_fork` (true), `upstream_owner` (non-empty), `upstream_repo` (non-empty)
89-
- If validation fails, halt and instruct user: "Invalid fork configuration in `.fork-info.json`. Please run `/specify` again with complete fork information: upstream owner, upstream repo."
86+
- Run `git remote -v` to check configured remotes
87+
- **If `upstream` remote exists** (fork mode):
88+
- Parse the upstream URL to extract owner and repo name
89+
- Example: `upstream https://github.com/PSModule/Utilities.git` → owner: `PSModule`, repo: `Utilities`
9090
- Use `upstream_owner/upstream_repo` for all GitHub operations
91-
- **If not exists** (local mode - default):
92-
- Use the current repository (origin) for all GitHub operations
91+
- **If only `origin` remote exists** (local mode - default):
92+
- Parse the origin URL to extract owner and repo name
93+
- Use `origin_owner/origin_repo` for all GitHub operations
9394
- Append or update the tasks.md content in the existing PR description
9495
- Format tasks with checkboxes for each task phase:
9596
* Setup: `- [ ] T001: Task description`

README.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,28 +373,56 @@ Build:
373373

374374
### Example 3 - Configuring the Repository Linter
375375

376-
This example shows how to configure the repository linter to skip certain validations or disable the linter entirely.
376+
The workflow uses [super-linter](https://github.com/super-linter/super-linter) to lint your repository code.
377+
The linter runs on pull requests and provides status updates directly in the PR.
378+
379+
#### Disabling the Linter
380+
381+
You can skip repository linting entirely:
377382

378383
```yaml
379-
# Skip the linter entirely
380384
Linter:
381385
Skip: true
382386
```
383387

388+
#### Configuring Linter Validation Rules
389+
390+
The workflow supports all environment variables that super-linter provides. You can configure these through the `Linter.env` object:
391+
384392
```yaml
385-
# Disable specific linter validations
386393
Linter:
387394
env:
395+
# Disable specific validations
388396
VALIDATE_BIOME_FORMAT: false
389397
VALIDATE_BIOME_LINT: false
390398
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
391399
VALIDATE_JSCPD: false
392400
VALIDATE_JSON_PRETTIER: false
393401
VALIDATE_MARKDOWN_PRETTIER: false
394402
VALIDATE_YAML_PRETTIER: false
403+
404+
# Or enable only specific validations
405+
VALIDATE_YAML: true
406+
VALIDATE_JSON: true
407+
VALIDATE_MARKDOWN: true
395408
```
396409

397-
For a complete list of available linter environment variables, see the [super-linter documentation](https://github.com/super-linter/super-linter#environment-variables).
410+
#### Additional Configuration
411+
412+
Any super-linter environment variable can be set through the `Linter.env` object:
413+
414+
```yaml
415+
Linter:
416+
env:
417+
LOG_LEVEL: DEBUG
418+
FILTER_REGEX_EXCLUDE: '.*test.*'
419+
VALIDATE_ALL_CODEBASE: false
420+
```
421+
422+
**Note:** The `GITHUB_TOKEN` is automatically provided by the workflow to enable status updates in pull requests.
423+
424+
For a complete list of available environment variables and configuration options, see the
425+
[super-linter environment variables documentation](https://github.com/super-linter/super-linter#environment-variables).
398426

399427
## Specifications and practices
400428

0 commit comments

Comments
 (0)