Add gitignore-claude template and wire into registration flows
Introduce scripts/project_rules/gitignore-claude.template with the fleet pattern that tracks .claude/rules/ while ignoring machine-local Claude state. ensure_gitignore_claude_rules.py applies it during statehub register, register_project.sh, and update_agent_instruction_files fleet regen.
This commit is contained in:
parent
0d2fca5711
commit
638cdc4ee2
7 changed files with 128 additions and 0 deletions
|
|
@ -12,6 +12,13 @@ from pathlib import Path
|
|||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
TEMPLATE_DIR = ROOT / "scripts" / "project_rules"
|
||||
|
||||
import sys
|
||||
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from scripts.ensure_gitignore_claude_rules import ensure_claude_gitignore # noqa: E402
|
||||
API_BASE = "http://127.0.0.1:8000"
|
||||
HOME_ROOT = Path("/home/worsch")
|
||||
WP_FILE_RE = re.compile(r"^([A-Za-z][A-Za-z0-9-]*-WP)-\d+", re.IGNORECASE)
|
||||
|
|
@ -189,6 +196,8 @@ def update_repo(
|
|||
if not scope_path.exists():
|
||||
scope_path.write_text(render(scope_template, values), encoding="utf-8")
|
||||
|
||||
ensure_claude_gitignore(path / ".gitignore")
|
||||
|
||||
rules_dir = path / ".claude" / "rules"
|
||||
rules_dir.mkdir(parents=True, exist_ok=True)
|
||||
for name, template in rule_templates.items():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue