Skip to content

Commit 705e312

Browse files
Merge pull request #15 from diazMelgarejo/merged-local-rebased-on-origin
2 parents 44593b7 + c935a92 commit 705e312

17 files changed

Lines changed: 1561 additions & 75 deletions

File tree

.agents/skills/periscope/SKILL.md

Lines changed: 122 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# periscope Development Patterns
22

3-
> Synthesized from two ECC repository-analysis runs and verified against the
4-
> repository's documented architecture and test layout.
3+
> Synthesized from ECC repository-analysis runs (PR #16 harmonization + PR #18
4+
> additive replay) and verified against the repository's documented architecture
5+
> and test layout.
56
67
## Overview
78

@@ -38,13 +39,17 @@ export function getUserProfile(id: string) {
3839

3940
- Use Conventional Commits.
4041
- Choose the prefix that describes the change; observed prefixes include
41-
`build`, `chore`, and `fix`.
42+
`build`, `chore`, `docs`, `feat`, `fix`, and scoped variants such as
43+
`fix(frontend)` and `fix(desktop)`.
4244
- Keep the subject concise and include a scope when it adds useful context.
4345

4446
```text
4547
build(deps): update frontend dependencies
4648
fix(desktop): honor PERISCOPE_VERSION override
4749
chore(git): sync attribution guard scripts
50+
docs: align layer-2 synthesis analysis tip SHA
51+
fix(frontend): remove stale ActivityMinimap and pass svelte-check
52+
feat(parser): add session discovery for a new agent
4853
```
4954

5055
## Workflows
@@ -82,6 +87,111 @@ chore(git): sync attribution guard scripts
8287
4. Run the checks for each affected subsystem.
8388
5. Commit the manifest and lockfile together with a `build(deps)` subject.
8489

90+
### Integration Analysis Doc
91+
92+
**Trigger:** When updating layer-2 integrative synthesis verification or tip SHA
93+
94+
**Guide:** `/update-integration-analysis`
95+
96+
**Instinct:** `periscope-workflow-update-integration-analysis-doc` — numbered
97+
workflow steps; trigger: "when doing update integration analysis doc".
98+
99+
1. Edit `docs/INTEGRATION-SYNTHESIS-LAYER2-ANALYSIS.md` for verification gates,
100+
branch references, or tip SHA alignment.
101+
2. Use a `docs:` Conventional Commit subject that names the alignment work.
102+
3. Keep the analysis consistent with the current `merged` integration line.
103+
104+
### Add New Agent Integration
105+
106+
**Trigger:** When adding support for a new AI agent parser/discovery path
107+
108+
**Guide:** `/add-new-agent-integration` (instinct:
109+
`periscope-workflow-add-new-agent-integration`)
110+
111+
1. Implement a parser in `internal/parser/{agent}.go` with
112+
`internal/parser/{agent}_test.go`.
113+
2. Add discovery logic in `internal/parser/discovery.go`.
114+
3. Update normalization in `internal/parser/types.go` and `taxonomy.go`.
115+
4. Wire the agent into `internal/sync/engine.go` and integration tests.
116+
5. Update agent directory/env configuration in `internal/config/config.go`.
117+
6. Update frontend agent metadata in `frontend/src/lib/utils/agents.ts` and
118+
related UI filters.
119+
7. Update documentation (`README.md`, `AGENTS.md`) when user-facing behavior
120+
changes.
121+
122+
### Add New Feature (Full Stack)
123+
124+
**Trigger:** When implementing a user-facing feature spanning backend and UI
125+
126+
**Guide:** `/add-new-feature-full-stack` (instinct:
127+
`periscope-workflow-add-new-feature-full-stack`)
128+
129+
1. Design and implement DB schema changes in `internal/db/schema.sql` and
130+
`internal/db/*.go`.
131+
2. Add or update backend logic in `internal/server/` and `internal/sync/`.
132+
3. Expose API endpoints in `internal/server/`.
133+
4. Implement Svelte components/stores under `frontend/src/lib/`.
134+
5. Update frontend types under `frontend/src/lib/api/types/`.
135+
6. Add or update unit and e2e tests for the touched subsystems.
136+
7. Update docs when operator or contributor behavior changes.
137+
138+
### Backend Bugfix with Test
139+
140+
**Trigger:** When fixing backend logic
141+
142+
**Guide:** `/backend-bugfix-with-test` (instinct:
143+
`periscope-instinct-backend-bugfix-with-test`)
144+
145+
1. Fix the bug in the relevant Go package under `internal/`.
146+
2. Add or update a regression test in the colocated `*_test.go` file.
147+
3. Run targeted and affected package tests before handoff.
148+
149+
### Frontend Bugfix with Test
150+
151+
**Trigger:** When fixing frontend UI or store logic
152+
153+
**Guide:** `/frontend-bugfix-with-test` (instinct:
154+
`periscope-instinct-frontend-bugfix-with-test`)
155+
156+
1. Fix the bug in the relevant Svelte/TypeScript module.
157+
2. Add or update a Vitest or Playwright test as appropriate.
158+
3. Run `cd frontend && npm test` and any affected e2e journeys.
159+
160+
### Refactor and Test Split
161+
162+
**Trigger:** When test files become large or mixed across concerns
163+
164+
**Guide:** `/refactoring` (command scaffold:
165+
`.claude/commands/refactoring.md`)
166+
167+
1. Identify oversized or mixed test files.
168+
2. Split into per-agent or per-feature test files.
169+
3. Move or create fixtures under `internal/parser/testdata/` when needed.
170+
4. Verify all tests still pass.
171+
172+
### Database Schema Migration and Sync
173+
174+
**Trigger:** When changing or extending the SQLite schema
175+
176+
**Guide:** `/database-migration` (command scaffold:
177+
`.claude/commands/database-migration.md`)
178+
179+
1. Edit `internal/db/schema.sql` and related Go structs/queries.
180+
2. Update sync logic in `internal/sync/` when ingestion behavior changes.
181+
3. Add or update tests in `internal/db/*_test.go` and sync integration tests.
182+
4. Handle resync/migration semantics without destroying archived session data.
183+
5. Update frontend types when API payloads change.
184+
185+
### Feature Development Scaffold
186+
187+
**Trigger:** When starting a multi-file feature with unclear boundaries
188+
189+
**Guide:** `/feature-development` (command scaffold:
190+
`.claude/commands/feature-development.md`)
191+
192+
Use the scaffold to sequence discovery, smallest coherent change, verification,
193+
and handoff notes before expanding scope.
194+
85195
### Testing
86196

87197
**Trigger:** When verifying correctness
@@ -102,6 +212,7 @@ chore(git): sync attribution guard scripts
102212
- PostgreSQL integration tests use the `pgtest` build tag and a dedicated test
103213
database.
104214
- Use `t.TempDir()` for isolated Go test data.
215+
- Use `internal/parser/testdata/` for parser fixtures.
105216

106217
## Verified Commands
107218

@@ -113,3 +224,11 @@ chore(git): sync attribution guard scripts
113224
| `make e2e` | Run Playwright end-to-end tests |
114225
| `make vet` | Run Go static checks |
115226
| `make lint` | Run configured Go linters |
227+
228+
## Workflow Command Scaffolds
229+
230+
| Command | Scaffold path |
231+
| --- | --- |
232+
| `/database-migration` | `.claude/commands/database-migration.md` |
233+
| `/feature-development` | `.claude/commands/feature-development.md` |
234+
| `/refactoring` | `.claude/commands/refactoring.md` |
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: database-migration
3+
description: Workflow command scaffold for database-migration in periscope.
4+
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
5+
---
6+
7+
# /database-migration
8+
9+
Use this workflow when working on **database-migration** in `periscope`.
10+
11+
## Goal
12+
13+
Database schema changes with migration files
14+
15+
## Common Files
16+
17+
- `**/schema.*`
18+
19+
## Suggested Sequence
20+
21+
1. Understand the current state and failure mode before editing.
22+
2. Make the smallest coherent change that satisfies the workflow goal.
23+
3. Run the most relevant verification for touched files.
24+
4. Summarize what changed and what still needs review.
25+
26+
## Typical Commit Signals
27+
28+
- Create migration file
29+
- Update schema definitions
30+
- Generate/update types
31+
32+
## Notes
33+
34+
- Treat this as a scaffold, not a hard-coded script.
35+
- Update the command if the workflow evolves materially.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: feature-development
3+
description: Workflow command scaffold for feature-development in periscope.
4+
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
5+
---
6+
7+
# /feature-development
8+
9+
Use this workflow when working on **feature-development** in `periscope`.
10+
11+
## Goal
12+
13+
Standard feature implementation workflow
14+
15+
## Common Files
16+
17+
- `frontend/src/lib/stores/*`
18+
- `frontend/src/lib/api/*`
19+
- `frontend/src/lib/api/types/*`
20+
- `**/*.test.*`
21+
- `**/api/**`
22+
23+
## Suggested Sequence
24+
25+
1. Understand the current state and failure mode before editing.
26+
2. Make the smallest coherent change that satisfies the workflow goal.
27+
3. Run the most relevant verification for touched files.
28+
4. Summarize what changed and what still needs review.
29+
30+
## Typical Commit Signals
31+
32+
- Add feature implementation
33+
- Add tests for feature
34+
- Update documentation
35+
36+
## Notes
37+
38+
- Treat this as a scaffold, not a hard-coded script.
39+
- Update the command if the workflow evolves materially.

.claude/commands/refactoring.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: refactoring
3+
description: Workflow command scaffold for refactoring in periscope.
4+
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
5+
---
6+
7+
# /refactoring
8+
9+
Use this workflow when working on **refactoring** in `periscope`.
10+
11+
## Goal
12+
13+
Code refactoring and cleanup workflow
14+
15+
## Common Files
16+
17+
- `src/**/*`
18+
19+
## Suggested Sequence
20+
21+
1. Understand the current state and failure mode before editing.
22+
2. Make the smallest coherent change that satisfies the workflow goal.
23+
3. Run the most relevant verification for touched files.
24+
4. Summarize what changed and what still needs review.
25+
26+
## Typical Commit Signals
27+
28+
- Ensure tests pass before refactor
29+
- Refactor code structure
30+
- Verify tests still pass
31+
32+
## Notes
33+
34+
- Treat this as a scaffold, not a hard-coded script.
35+
- Update the command if the workflow evolves materially.

0 commit comments

Comments
 (0)