@next-friday/create-app 2.1.9 → 4.0.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/package.json +1 -1
- package/templates/base/.agents/agents.json +7 -0
- package/templates/base/.agents/hooks/agent-format-after-edit.sh +15 -0
- package/templates/base/.agents/hooks/agent-production-gate.sh +10 -0
- package/templates/base/.agents/hooks/agent-test-edit-gate.sh +25 -0
- package/templates/base/.agents/review.md +21 -0
- package/templates/base/.agents/rules/no-suppression.md +1 -1
- package/templates/base/.agents/skills/babysit-pr/SKILL.md +8 -0
- package/templates/base/.agents/skills/brand-policy/SKILL.md +12 -0
- package/templates/base/.agents/skills/compliance-policy/SKILL.md +12 -0
- package/templates/base/{.cursor/rules/git-workflow.mdc → .agents/skills/git-workflow/SKILL.md} +2 -2
- package/templates/base/{.cursor/rules/script-driven-changes.mdc → .agents/skills/script-driven-changes/SKILL.md} +2 -2
- package/templates/base/.agents/skills/security-policy/SKILL.md +12 -0
- package/templates/base/.agents/skills/ux-policy/SKILL.md +12 -0
- package/templates/base/.agents/skills/write-intent/SKILL.md +30 -0
- package/templates/base/.agents/skills/write-spec/SKILL.md +12 -0
- package/templates/base/.claude/managed-settings.example.json +26 -0
- package/templates/base/.claude/settings.json +31 -0
- package/templates/base/.claude/skills/babysit-pr/SKILL.md +8 -0
- package/templates/base/.claude/skills/brand-policy/SKILL.md +12 -0
- package/templates/base/.claude/skills/compliance-policy/SKILL.md +12 -0
- package/templates/base/{.agents/rules/git-workflow.md → .claude/skills/git-workflow/SKILL.md} +5 -0
- package/templates/base/{.agents/rules/script-driven-changes.md → .claude/skills/script-driven-changes/SKILL.md} +5 -0
- package/templates/base/.claude/skills/security-policy/SKILL.md +12 -0
- package/templates/base/.claude/skills/ux-policy/SKILL.md +12 -0
- package/templates/base/.claude/skills/write-intent/SKILL.md +30 -0
- package/templates/base/.claude/skills/write-spec/SKILL.md +12 -0
- package/templates/base/.cursor/BUGBOT.md +3 -2
- package/templates/base/.cursor/hooks.json +15 -0
- package/templates/base/.cursor/rules/no-suppression.mdc +1 -1
- package/templates/base/.cursor/skills/babysit-pr/SKILL.md +8 -0
- package/templates/base/.cursor/skills/brand-policy/SKILL.md +12 -0
- package/templates/base/.cursor/skills/compliance-policy/SKILL.md +12 -0
- package/templates/base/.cursor/skills/git-workflow/SKILL.md +15 -0
- package/templates/base/.cursor/skills/script-driven-changes/SKILL.md +12 -0
- package/templates/base/.cursor/skills/security-policy/SKILL.md +12 -0
- package/templates/base/.cursor/skills/ux-policy/SKILL.md +12 -0
- package/templates/base/.cursor/skills/write-intent/SKILL.md +30 -0
- package/templates/base/.cursor/skills/write-spec/SKILL.md +12 -0
- package/templates/base/.github/workflows/agent-evals.yml +128 -0
- package/templates/base/.github/workflows/claude.yml +39 -0
- package/templates/base/.github/zizmor.yml +1 -1
- package/templates/base/REVIEW.md +21 -0
- package/templates/base/SETUP.md +108 -0
- package/templates/base/bands.yaml +10 -0
- package/templates/base/evals/README.md +15 -0
- package/templates/base/evals/check.sh +17 -0
- package/templates/base/intent/README.md +8 -0
- package/templates/base/lessons/README.md +3 -0
- package/templates/base/scripts/sync-agent-rules.ts +111 -1
- package/templates/nestjs/.agents/agents/verifier.md +1 -0
- package/templates/nestjs/.agents/rules.json +23 -9
- package/templates/nestjs/.claude/agents/verifier.md +7 -0
- package/templates/nestjs/.claude/rules/constitution-changes.md +25 -0
- package/templates/nestjs/.claude/rules/diagnostics-and-error-handling.md +13 -0
- package/templates/nestjs/.claude/rules/structured-logging.md +9 -0
- package/templates/nestjs/.cursor/agents/verifier.md +7 -0
- package/templates/{base → nestjs}/.cursor/rules/constitution-changes.mdc +2 -1
- package/templates/{base → nestjs}/.cursor/rules/diagnostics-and-error-handling.mdc +2 -1
- package/templates/{base → nestjs}/.cursor/rules/structured-logging.mdc +2 -1
- package/templates/nestjs/.github/workflows/ci.yml +44 -0
- package/templates/nestjs/AGENTS.md +17 -4
- package/templates/nestjs/README.md +1 -16
- package/templates/nextjs/.agents/agents/verifier.md +1 -0
- package/templates/nextjs/.agents/mcp.json +8 -0
- package/templates/nextjs/.agents/rules.json +23 -9
- package/templates/nextjs/.claude/agents/verifier.md +7 -0
- package/templates/nextjs/.claude/rules/constitution-changes.md +25 -0
- package/templates/nextjs/.claude/rules/diagnostics-and-error-handling.md +15 -0
- package/templates/nextjs/.claude/rules/structured-logging.md +11 -0
- package/templates/nextjs/.cursor/agents/verifier.md +7 -0
- package/templates/nextjs/.cursor/mcp.json +8 -0
- package/templates/nextjs/.cursor/rules/constitution-changes.mdc +11 -0
- package/templates/nextjs/.cursor/rules/diagnostics-and-error-handling.mdc +13 -0
- package/templates/nextjs/.cursor/rules/structured-logging.mdc +9 -0
- package/templates/nextjs/.github/workflows/ci.yml +44 -0
- package/templates/nextjs/.mcp.json +8 -0
- package/templates/nextjs/AGENTS.md +17 -4
- package/templates/nextjs/README.md +1 -16
- package/templates/nodejs/.agents/agents/verifier.md +1 -0
- package/templates/nodejs/.agents/rules.json +23 -9
- package/templates/nodejs/.claude/agents/verifier.md +7 -0
- package/templates/nodejs/.claude/rules/constitution-changes.md +25 -0
- package/templates/nodejs/.claude/rules/diagnostics-and-error-handling.md +13 -0
- package/templates/nodejs/.claude/rules/structured-logging.md +9 -0
- package/templates/nodejs/.cursor/agents/verifier.md +7 -0
- package/templates/nodejs/.cursor/rules/constitution-changes.mdc +11 -0
- package/templates/nodejs/.cursor/rules/diagnostics-and-error-handling.mdc +13 -0
- package/templates/nodejs/.cursor/rules/structured-logging.mdc +9 -0
- package/templates/nodejs/.github/workflows/ci.yml +44 -0
- package/templates/nodejs/AGENTS.md +17 -4
- package/templates/nodejs/README.md +1 -16
- package/templates/payload/.agents/agents/verifier.md +1 -0
- package/templates/payload/.agents/mcp.json +8 -0
- package/templates/payload/.agents/rules.json +23 -9
- package/templates/payload/.claude/agents/verifier.md +7 -0
- package/templates/payload/.claude/rules/constitution-changes.md +25 -0
- package/templates/payload/.claude/rules/diagnostics-and-error-handling.md +15 -0
- package/templates/payload/.claude/rules/structured-logging.md +11 -0
- package/templates/payload/.cursor/agents/verifier.md +7 -0
- package/templates/payload/.cursor/mcp.json +8 -0
- package/templates/payload/.cursor/rules/constitution-changes.mdc +11 -0
- package/templates/payload/.cursor/rules/diagnostics-and-error-handling.mdc +13 -0
- package/templates/payload/.cursor/rules/structured-logging.mdc +9 -0
- package/templates/payload/.github/workflows/ci.yml +44 -0
- package/templates/payload/.mcp.json +8 -0
- package/templates/payload/AGENTS.md +17 -4
- package/templates/payload/README.md +1 -16
- package/templates/turborepo/.agents/agents/verifier.md +1 -0
- package/templates/turborepo/.agents/mcp.json +8 -0
- package/templates/turborepo/.agents/rules.json +23 -9
- package/templates/turborepo/.claude/agents/verifier.md +7 -0
- package/templates/turborepo/.claude/rules/constitution-changes.md +25 -0
- package/templates/turborepo/.claude/rules/diagnostics-and-error-handling.md +15 -0
- package/templates/turborepo/.claude/rules/structured-logging.md +11 -0
- package/templates/turborepo/.cursor/agents/verifier.md +7 -0
- package/templates/turborepo/.cursor/mcp.json +8 -0
- package/templates/turborepo/.cursor/rules/constitution-changes.mdc +11 -0
- package/templates/turborepo/.cursor/rules/diagnostics-and-error-handling.mdc +13 -0
- package/templates/turborepo/.cursor/rules/structured-logging.mdc +9 -0
- package/templates/turborepo/.github/workflows/ci.yml +44 -0
- package/templates/turborepo/.mcp.json +8 -0
- package/templates/turborepo/AGENTS.md +17 -4
- package/templates/turborepo/README.md +1 -16
- package/templates/base/.claude/rules/constitution-changes.md +0 -1
- package/templates/base/.claude/rules/diagnostics-and-error-handling.md +0 -1
- package/templates/base/.claude/rules/git-workflow.md +0 -1
- package/templates/base/.claude/rules/script-driven-changes.md +0 -1
- package/templates/base/.claude/rules/structured-logging.md +0 -1
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -uo pipefail
|
|
3
|
+
|
|
4
|
+
input=$(cat)
|
|
5
|
+
cd "${CLAUDE_PROJECT_DIR:-${CURSOR_PROJECT_DIR:-$PWD}}" || exit 0
|
|
6
|
+
path=$(jq -r '.tool_input.file_path // .tool_input.notebook_path // .file_path // empty' <<< "$input")
|
|
7
|
+
[[ -n $path && -f $path ]] || exit 0
|
|
8
|
+
|
|
9
|
+
case $path in
|
|
10
|
+
*.ts | *.tsx | *.js | *.jsx | *.mjs | *.cjs)
|
|
11
|
+
pnpm exec eslint --fix --cache --max-warnings=0 --no-warn-ignored --no-inline-config "$path" > /dev/null 2>&1
|
|
12
|
+
;;
|
|
13
|
+
esac
|
|
14
|
+
pnpm exec prettier --write --cache --ignore-unknown "$path" > /dev/null 2>&1
|
|
15
|
+
exit 0
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Production deploys require a named release authorization
|
|
3
|
+
cmd=$(jq -r '.tool_input.command // .command' < /dev/stdin)
|
|
4
|
+
if [[ "$cmd" == *"deploy"* && "$cmd" == *"production"* ]]; then
|
|
5
|
+
if [ -z "$RELEASE_APPROVAL" ]; then
|
|
6
|
+
echo "Production deploys need a release authorization." >&2
|
|
7
|
+
exit 2 # exit 2 blocks the action; the message goes to Claude
|
|
8
|
+
fi
|
|
9
|
+
fi
|
|
10
|
+
exit 0
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -uo pipefail
|
|
3
|
+
|
|
4
|
+
allow() {
|
|
5
|
+
printf '%s\n' '{"permission":"allow"}'
|
|
6
|
+
exit 0
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
block() {
|
|
10
|
+
jq -n --arg message "$1" '{permission:"deny",user_message:$message,agent_message:$message}'
|
|
11
|
+
printf 'agent-test-edit-gate: %s\n' "$1" >&2
|
|
12
|
+
exit 2
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
trap 'block ".agents/hooks/agent-test-edit-gate.sh failed. Stop and report this error to the user; agents may not edit the gate."' ERR
|
|
16
|
+
command -v jq > /dev/null || block "jq is required to read the hook input. Install it: https://jqlang.org/download/"
|
|
17
|
+
input=$(cat)
|
|
18
|
+
project=${CLAUDE_PROJECT_DIR:-${CURSOR_PROJECT_DIR:-$PWD}}
|
|
19
|
+
[[ -e "$project/.git/bug-fix-in-progress" ]] || allow
|
|
20
|
+
path=$(jq -r '.tool_input.file_path // .tool_input.path // .tool_input.notebook_path // .file_path // empty' <<< "$input")
|
|
21
|
+
[[ -n $path ]] || allow
|
|
22
|
+
if [[ $path =~ (\.test\.|\.spec\.|\.e2e\.test\.|(^|/)tests?/) ]]; then
|
|
23
|
+
block "A bug fix is in progress (.git/bug-fix-in-progress), so $path cannot change. Fix the code, not the test."
|
|
24
|
+
fi
|
|
25
|
+
allow
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Review instructions
|
|
2
|
+
|
|
3
|
+
## Passes
|
|
4
|
+
|
|
5
|
+
Run three passes and tag each finding with its pass:
|
|
6
|
+
|
|
7
|
+
- Bugs: logic errors, broken edge cases, subtle regressions
|
|
8
|
+
- Security: injection risks, authentication gaps, PII in logs
|
|
9
|
+
- Compliance: the change matches spec.md, plan.md and our design principles
|
|
10
|
+
|
|
11
|
+
## What Important means here
|
|
12
|
+
|
|
13
|
+
Reserve Important for findings that would break behavior, leak data or breach a policy. Style and naming are nits.
|
|
14
|
+
|
|
15
|
+
## Cap the nits
|
|
16
|
+
|
|
17
|
+
Report at most five nits per review; summarize the rest as a count.
|
|
18
|
+
|
|
19
|
+
## Do not report
|
|
20
|
+
|
|
21
|
+
Generated files under src/gen/ and anything CI already enforces.
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Fix what a linter, type checker, or scanner reports, including the replacement it suggests. Comments a tool requires follow `code-comments.md`.
|
|
4
4
|
|
|
5
|
-
Record an accepted risk only in that tool's central file, with an owner
|
|
5
|
+
Record an accepted risk only in that tool's central file, with an owner and a reason: `.github/zizmor.yml` for zizmor, `osv-scanner.toml` for OSV-Scanner, `.gitleaksignore` for gitleaks, `.trivyignore` for Trivy, or `.hadolint.yaml` for hadolint. Create the file or key when the first accepted risk needs it. Do not add inline suppressions; `.agents/hooks/agent-suppression-gate.sh` defines the rejected directives.
|
|
6
6
|
|
|
7
7
|
When a finding looks wrong, stop and cite the tool's documentation to the user. Report a finding as fixed only when the tool passes, with any accepted risk in that central file.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: babysit-pr
|
|
3
|
+
description: Drive a pull request you opened until it waits only on code owner approval. Use when asked to babysit, watch, or finish a pull request.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Babysit a pull request
|
|
7
|
+
|
|
8
|
+
Sweep the unresolved review comments and failing checks on the pull request, address them, and push the fixes. Repeat until the pull request is green and waiting only on code owner approval. Never approve or merge it.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brand-policy
|
|
3
|
+
description: Apply the organization's brand policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Brand policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: compliance-policy
|
|
3
|
+
description: Apply the organization's compliance policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Compliance policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
package/templates/base/{.cursor/rules/git-workflow.mdc → .agents/skills/git-workflow/SKILL.md}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
name: git-workflow
|
|
3
|
+
description: Trunk-based branches, commits, and pull requests. Use when creating a branch, committing, pushing, or opening, updating, or merging a pull request.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Git Workflow
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
name: script-driven-changes
|
|
3
|
+
description: Change many files with a script, not by hand. Use when a change repeats one pattern across more than a few files, or needs a one-off script.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Scripts
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-policy
|
|
3
|
+
description: Apply the organization's security policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ux-policy
|
|
3
|
+
description: Apply the organization's UX policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# UX policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-intent
|
|
3
|
+
description: Write intent.md, the proto-spec that starts a change. Use whenever someone describes an idea, a problem, or a change they want, before a spec or code exists.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Write intent.md
|
|
7
|
+
|
|
8
|
+
1. Let the originator describe the problem in their own words: what they cannot do today, who is affected, what better looks like, and what is out of scope.
|
|
9
|
+
2. Brainstorm until the idea is concrete. Ask the questions an analyst would ask: scope, users, constraints, and what success looks like.
|
|
10
|
+
3. Write the result as `intent/<change>/intent.md`, where `<change>` is a short kebab-case name, using the template below.
|
|
11
|
+
4. Ask the originator to correct anything you misunderstood.
|
|
12
|
+
5. Commit `intent.md` and open a pull request. The product owner accepts it by merging the pull request, or rejects it by closing it.
|
|
13
|
+
|
|
14
|
+
## Template
|
|
15
|
+
|
|
16
|
+
```markdown
|
|
17
|
+
# Intent: <title>
|
|
18
|
+
|
|
19
|
+
Author: <name> (<team>). Status: draft.
|
|
20
|
+
|
|
21
|
+
## Problem
|
|
22
|
+
|
|
23
|
+
## Proposed outcome
|
|
24
|
+
|
|
25
|
+
## Affected users and systems
|
|
26
|
+
|
|
27
|
+
## Constraints
|
|
28
|
+
|
|
29
|
+
## Open questions
|
|
30
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-spec
|
|
3
|
+
description: Produce spec.md, the requirements and design spec, from an accepted intent.md. Use when an intent.md has been accepted and the change needs its spec.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Write spec.md
|
|
7
|
+
|
|
8
|
+
Read the `intent.md` the user names, and follow this prompt:
|
|
9
|
+
|
|
10
|
+
> Read the attached intent.md and produce a requirements and design spec for integrating it into our existing codebase. Apply the skills available to you so the plan conforms to our brand guidelines, security policies and UX standards. Document the spec fully as spec.md, ready to hand to the engineering team. Describe clearly any areas of concern, especially where you cannot satisfy contradicting policies.
|
|
11
|
+
|
|
12
|
+
Write `spec.md` alongside that `intent.md`, in the same folder. Answer each open question from `intent.md`, or carry it forward.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"deny": ["Read(.env*)", "Read(./secrets/**)", "WebFetch", "Bash(curl *)", "Bash(wget *)"],
|
|
4
|
+
"allow": ["Bash(git *)", "Bash(make build)", "Bash(make test)", "Bash(make lint)"],
|
|
5
|
+
"disableBypassPermissionsMode": "disable"
|
|
6
|
+
},
|
|
7
|
+
"allowManagedPermissionRulesOnly": true,
|
|
8
|
+
"sandbox": {
|
|
9
|
+
"enabled": true,
|
|
10
|
+
"failIfUnavailable": true,
|
|
11
|
+
"allowUnsandboxedCommands": false,
|
|
12
|
+
"network": {"allowedDomains": ["git.internal.example.com", "registry.npmjs.org"]},
|
|
13
|
+
"credentials": {
|
|
14
|
+
"files": [
|
|
15
|
+
{"path": "~/.ssh", "mode": "deny"},
|
|
16
|
+
{"path": "~/.aws/credentials", "mode": "deny"}
|
|
17
|
+
],
|
|
18
|
+
"envVars": [{"name": "GITHUB_TOKEN", "mode": "deny"}]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"allowManagedHooksOnly": true,
|
|
22
|
+
"disableSideloadFlags": true,
|
|
23
|
+
"allowManagedMcpServersOnly": true,
|
|
24
|
+
"strictKnownMarketplaces": [{"source": "github", "repo": "example-corp/approved-plugins"}],
|
|
25
|
+
"requiredMinimumVersion": "2.1.193"
|
|
26
|
+
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
3
|
"permissions": {
|
|
4
|
+
"defaultMode": "plan",
|
|
5
|
+
"allow": [
|
|
6
|
+
"Bash(git *)",
|
|
7
|
+
"Bash(pnpm build)",
|
|
8
|
+
"Bash(pnpm test)",
|
|
9
|
+
"Bash(pnpm test:coverage)",
|
|
10
|
+
"Bash(pnpm verify:static)",
|
|
11
|
+
"Bash(pnpm verify)"
|
|
12
|
+
],
|
|
4
13
|
"deny": [
|
|
5
14
|
"Edit(./.agents/rules/**)",
|
|
6
15
|
"Edit(./.claude/rules/**)",
|
|
@@ -45,6 +54,12 @@
|
|
|
45
54
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.agents/hooks/agent-suppression-gate.sh",
|
|
46
55
|
"timeout": 10,
|
|
47
56
|
"onFailure": "block"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "command",
|
|
60
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.agents/hooks/agent-test-edit-gate.sh",
|
|
61
|
+
"timeout": 10,
|
|
62
|
+
"onFailure": "block"
|
|
48
63
|
}
|
|
49
64
|
]
|
|
50
65
|
},
|
|
@@ -56,6 +71,22 @@
|
|
|
56
71
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.agents/hooks/agent-shell-gate.sh",
|
|
57
72
|
"timeout": 10,
|
|
58
73
|
"onFailure": "block"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"type": "command",
|
|
77
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.agents/hooks/agent-production-gate.sh",
|
|
78
|
+
"timeout": 10
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"PostToolUse": [
|
|
84
|
+
{
|
|
85
|
+
"matcher": "Edit|Write|MultiEdit|NotebookEdit",
|
|
86
|
+
"hooks": [
|
|
87
|
+
{
|
|
88
|
+
"type": "command",
|
|
89
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.agents/hooks/agent-format-after-edit.sh"
|
|
59
90
|
}
|
|
60
91
|
]
|
|
61
92
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: babysit-pr
|
|
3
|
+
description: Drive a pull request you opened until it waits only on code owner approval. Use when asked to babysit, watch, or finish a pull request.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Babysit a pull request
|
|
7
|
+
|
|
8
|
+
Sweep the unresolved review comments and failing checks on the pull request, address them, and push the fixes. Repeat until the pull request is green and waiting only on code owner approval. Never approve or merge it.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brand-policy
|
|
3
|
+
description: Apply the organization's brand policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Brand policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: compliance-policy
|
|
3
|
+
description: Apply the organization's compliance policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Compliance policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: script-driven-changes
|
|
3
|
+
description: Change many files with a script, not by hand. Use when a change repeats one pattern across more than a few files, or needs a one-off script.
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Scripts
|
|
2
7
|
|
|
3
8
|
When a change repeats one pattern across more than a few files, run a script. Derive facts from the toolchain (TypeScript compiler API, `git`), not by reading files by eye. Edit by hand when the change needs judgment in one place.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-policy
|
|
3
|
+
description: Apply the organization's security policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ux-policy
|
|
3
|
+
description: Apply the organization's UX policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# UX policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-intent
|
|
3
|
+
description: Write intent.md, the proto-spec that starts a change. Use whenever someone describes an idea, a problem, or a change they want, before a spec or code exists.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Write intent.md
|
|
7
|
+
|
|
8
|
+
1. Let the originator describe the problem in their own words: what they cannot do today, who is affected, what better looks like, and what is out of scope.
|
|
9
|
+
2. Brainstorm until the idea is concrete. Ask the questions an analyst would ask: scope, users, constraints, and what success looks like.
|
|
10
|
+
3. Write the result as `intent/<change>/intent.md`, where `<change>` is a short kebab-case name, using the template below.
|
|
11
|
+
4. Ask the originator to correct anything you misunderstood.
|
|
12
|
+
5. Commit `intent.md` and open a pull request. The product owner accepts it by merging the pull request, or rejects it by closing it.
|
|
13
|
+
|
|
14
|
+
## Template
|
|
15
|
+
|
|
16
|
+
```markdown
|
|
17
|
+
# Intent: <title>
|
|
18
|
+
|
|
19
|
+
Author: <name> (<team>). Status: draft.
|
|
20
|
+
|
|
21
|
+
## Problem
|
|
22
|
+
|
|
23
|
+
## Proposed outcome
|
|
24
|
+
|
|
25
|
+
## Affected users and systems
|
|
26
|
+
|
|
27
|
+
## Constraints
|
|
28
|
+
|
|
29
|
+
## Open questions
|
|
30
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-spec
|
|
3
|
+
description: Produce spec.md, the requirements and design spec, from an accepted intent.md. Use when an intent.md has been accepted and the change needs its spec.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Write spec.md
|
|
7
|
+
|
|
8
|
+
Read the `intent.md` the user names, and follow this prompt:
|
|
9
|
+
|
|
10
|
+
> Read the attached intent.md and produce a requirements and design spec for integrating it into our existing codebase. Apply the skills available to you so the plan conforms to our brand guidelines, security policies and UX standards. Document the spec fully as spec.md, ready to hand to the engineering team. Describe clearly any areas of concern, especially where you cannot satisfy contradicting policies.
|
|
11
|
+
|
|
12
|
+
Write `spec.md` alongside that `intent.md`, in the same folder. Answer each open question from `intent.md`, or carry it forward.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Review pull requests against the project's agent guide and rules:
|
|
4
4
|
|
|
5
|
+
- [Review instructions](../.agents/review.md)
|
|
5
6
|
- [Agent guide](../AGENTS.md)
|
|
6
7
|
- [Agent-Owned Work](../.agents/rules/agent-owned-work.md)
|
|
7
8
|
- [Owned Checks](../.agents/rules/automation-owned-checks.md)
|
|
@@ -15,10 +16,10 @@ Review pull requests against the project's agent guide and rules:
|
|
|
15
16
|
- [Test Admission](../.agents/rules/deterministic-testing.md)
|
|
16
17
|
- [Diagnostics](../.agents/rules/diagnostics-and-error-handling.md)
|
|
17
18
|
- [Evidence](../.agents/rules/evidence-before-claims.md)
|
|
18
|
-
- [Git Workflow](../.agents/
|
|
19
|
+
- [Git Workflow](../.agents/skills/git-workflow/SKILL.md)
|
|
19
20
|
- [Findings](../.agents/rules/no-suppression.md)
|
|
20
21
|
- [Platform and Library First](../.agents/rules/platform-and-library-first.md)
|
|
21
|
-
- [Scripts](../.agents/
|
|
22
|
+
- [Scripts](../.agents/skills/script-driven-changes/SKILL.md)
|
|
22
23
|
- [Sibling Style](../.agents/rules/single-author-style.md)
|
|
23
24
|
- [Logging](../.agents/rules/structured-logging.md)
|
|
24
25
|
- [TypeScript-First](../.agents/rules/typescript-first.md)
|
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
"matcher": "Write|StrReplace|Delete",
|
|
14
14
|
"timeout": 10,
|
|
15
15
|
"failClosed": true
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"command": ".agents/hooks/agent-test-edit-gate.sh",
|
|
19
|
+
"matcher": "Write|StrReplace",
|
|
20
|
+
"timeout": 10,
|
|
21
|
+
"failClosed": true
|
|
16
22
|
}
|
|
17
23
|
],
|
|
18
24
|
"beforeShellExecution": [
|
|
@@ -20,6 +26,15 @@
|
|
|
20
26
|
"command": ".agents/hooks/agent-shell-gate.sh",
|
|
21
27
|
"timeout": 10,
|
|
22
28
|
"failClosed": true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"command": ".agents/hooks/agent-production-gate.sh",
|
|
32
|
+
"timeout": 10
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"afterFileEdit": [
|
|
36
|
+
{
|
|
37
|
+
"command": ".agents/hooks/agent-format-after-edit.sh"
|
|
23
38
|
}
|
|
24
39
|
]
|
|
25
40
|
}
|
|
@@ -7,6 +7,6 @@ alwaysApply: true
|
|
|
7
7
|
|
|
8
8
|
Fix what a linter, type checker, or scanner reports, including the replacement it suggests. Comments a tool requires follow `code-comments.md`.
|
|
9
9
|
|
|
10
|
-
Record an accepted risk only in that tool's central file, with an owner
|
|
10
|
+
Record an accepted risk only in that tool's central file, with an owner and a reason: `.github/zizmor.yml` for zizmor, `osv-scanner.toml` for OSV-Scanner, `.gitleaksignore` for gitleaks, `.trivyignore` for Trivy, or `.hadolint.yaml` for hadolint. Create the file or key when the first accepted risk needs it. Do not add inline suppressions; `.agents/hooks/agent-suppression-gate.sh` defines the rejected directives.
|
|
11
11
|
|
|
12
12
|
When a finding looks wrong, stop and cite the tool's documentation to the user. Report a finding as fixed only when the tool passes, with any accepted risk in that central file.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: babysit-pr
|
|
3
|
+
description: Drive a pull request you opened until it waits only on code owner approval. Use when asked to babysit, watch, or finish a pull request.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Babysit a pull request
|
|
7
|
+
|
|
8
|
+
Sweep the unresolved review comments and failing checks on the pull request, address them, and push the fixes. Repeat until the pull request is green and waiting only on code owner approval. Never approve or merge it.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brand-policy
|
|
3
|
+
description: Apply the organization's brand policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Brand policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: compliance-policy
|
|
3
|
+
description: Apply the organization's compliance policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Compliance policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-workflow
|
|
3
|
+
description: Trunk-based branches, commits, and pull requests. Use when creating a branch, committing, pushing, or opening, updating, or merging a pull request.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git Workflow
|
|
7
|
+
|
|
8
|
+
The repository uses trunk-based development.
|
|
9
|
+
|
|
10
|
+
- Branch from the latest `origin/main`, in a worktree or a new branch named `<type>/<short-description>`. `main` is the only long-lived branch. The Git hooks block commits and pushes on it, except the first commit and push that create `main` in a new repository.
|
|
11
|
+
- Write commit messages in the format that `@next-friday/commitlint-config-friday` defines. The `commit-msg` hook rejects anything else.
|
|
12
|
+
- When work ends in a pull request, push its branch and open the pull request ready for review without asking. CI skips drafts. Work that does not end in one, such as an investigation or a prototype, opens none.
|
|
13
|
+
- Fill the pull request body from `.github/pull_request_template.md`.
|
|
14
|
+
- After you open a pull request, report its URL and continue. Drive it to merge-ready only when the user asks, and watch the checks with `gh pr checks --watch`. Merge only when the user asks to merge, land, or ship. Merge with `--squash`, bottom-up for a stack.
|
|
15
|
+
- Rebase and `git push --force-with-lease` only branches you own.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: script-driven-changes
|
|
3
|
+
description: Change many files with a script, not by hand. Use when a change repeats one pattern across more than a few files, or needs a one-off script.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Scripts
|
|
7
|
+
|
|
8
|
+
When a change repeats one pattern across more than a few files, run a script. Derive facts from the toolchain (TypeScript compiler API, `git`), not by reading files by eye. Edit by hand when the change needs judgment in one place.
|
|
9
|
+
|
|
10
|
+
Commit a script when a reviewer needs to rerun it or when the work outlives the session, and add it as a `package.json` script so knip counts it as an entry. Keep any other one-off script in a temporary directory outside the repository, and remove a committed script when its workflow ends. Fail on unmapped input. Back up before a destructive run.
|
|
11
|
+
|
|
12
|
+
Print summaries: counts, first errors. Verify what owned checks omit, such as the running app.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-policy
|
|
3
|
+
description: Apply the organization's security policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ux-policy
|
|
3
|
+
description: Apply the organization's UX policy. Use whenever writing or reviewing a spec.md, a plan, or code that this policy covers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# UX policy
|
|
7
|
+
|
|
8
|
+
Owner: <the named policy owner>
|
|
9
|
+
|
|
10
|
+
Source of truth: <where the written policy lives>
|
|
11
|
+
|
|
12
|
+
This policy is not written yet. Report that as an area of concern.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-intent
|
|
3
|
+
description: Write intent.md, the proto-spec that starts a change. Use whenever someone describes an idea, a problem, or a change they want, before a spec or code exists.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Write intent.md
|
|
7
|
+
|
|
8
|
+
1. Let the originator describe the problem in their own words: what they cannot do today, who is affected, what better looks like, and what is out of scope.
|
|
9
|
+
2. Brainstorm until the idea is concrete. Ask the questions an analyst would ask: scope, users, constraints, and what success looks like.
|
|
10
|
+
3. Write the result as `intent/<change>/intent.md`, where `<change>` is a short kebab-case name, using the template below.
|
|
11
|
+
4. Ask the originator to correct anything you misunderstood.
|
|
12
|
+
5. Commit `intent.md` and open a pull request. The product owner accepts it by merging the pull request, or rejects it by closing it.
|
|
13
|
+
|
|
14
|
+
## Template
|
|
15
|
+
|
|
16
|
+
```markdown
|
|
17
|
+
# Intent: <title>
|
|
18
|
+
|
|
19
|
+
Author: <name> (<team>). Status: draft.
|
|
20
|
+
|
|
21
|
+
## Problem
|
|
22
|
+
|
|
23
|
+
## Proposed outcome
|
|
24
|
+
|
|
25
|
+
## Affected users and systems
|
|
26
|
+
|
|
27
|
+
## Constraints
|
|
28
|
+
|
|
29
|
+
## Open questions
|
|
30
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write-spec
|
|
3
|
+
description: Produce spec.md, the requirements and design spec, from an accepted intent.md. Use when an intent.md has been accepted and the change needs its spec.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Write spec.md
|
|
7
|
+
|
|
8
|
+
Read the `intent.md` the user names, and follow this prompt:
|
|
9
|
+
|
|
10
|
+
> Read the attached intent.md and produce a requirements and design spec for integrating it into our existing codebase. Apply the skills available to you so the plan conforms to our brand guidelines, security policies and UX standards. Document the spec fully as spec.md, ready to hand to the engineering team. Describe clearly any areas of concern, especially where you cannot satisfy contradicting policies.
|
|
11
|
+
|
|
12
|
+
Write `spec.md` alongside that `intent.md`, in the same folder. Answer each open question from `intent.md`, or carry it forward.
|